mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added saga to change tags
This commit is contained in:
parent
033b5ca45d
commit
9df5e022dd
7 changed files with 44 additions and 11 deletions
|
@ -1,6 +1,7 @@
|
|||
import { api, configWithToken, resultMiddleware, errorMiddleware } from '~/utils/api';
|
||||
import { INode, IResultWithStatus, IComment } from '../types';
|
||||
import { API } from '~/constants/api';
|
||||
import { nodeUpdateTags } from './actions';
|
||||
|
||||
export const postNode = ({
|
||||
access,
|
||||
|
@ -57,3 +58,15 @@ export const getNodeComments = ({
|
|||
.get(API.NODE.COMMENT(id))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
||||
export const updateNodeTags = ({
|
||||
id,
|
||||
tags,
|
||||
access,
|
||||
}: ReturnType<typeof nodeUpdateTags> & { access: string }): Promise<
|
||||
IResultWithStatus<{ node: INode }>
|
||||
> =>
|
||||
api
|
||||
.post(API.NODE.UPDATE_TAGS(id), { tags }, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue