mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
comment deletion
This commit is contained in:
parent
59d544c5f4
commit
cf30f13eff
5 changed files with 49 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
import { api, configWithToken, resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
import { INode, IResultWithStatus, IComment } from '../types';
|
||||
import { API } from '~/constants/api';
|
||||
import { nodeUpdateTags, nodeLike, nodeStar, nodeLock } from './actions';
|
||||
import { nodeUpdateTags, nodeLike, nodeStar, nodeLock, nodeLockComment } from './actions';
|
||||
import { INodeState } from './reducer';
|
||||
|
||||
export const postNode = ({
|
||||
|
@ -163,3 +163,16 @@ export const postNodeLock = ({
|
|||
.post(API.NODE.POST_LOCK(id), { is_locked }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
||||
export const postNodeLockComment = ({
|
||||
id,
|
||||
is_locked,
|
||||
current,
|
||||
access,
|
||||
}: ReturnType<typeof nodeLockComment> & { access: string; current: INode['id'] }): Promise<
|
||||
IResultWithStatus<{ deleted_at: INode['deleted_at'] }>
|
||||
> =>
|
||||
api
|
||||
.post(API.NODE.POST_LOCK_COMMENT(current, id), { is_locked }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue