1
0
Fork 0
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:
Fedor Katurov 2019-10-09 16:12:27 +07:00
parent 033b5ca45d
commit 9df5e022dd
7 changed files with 44 additions and 11 deletions

View file

@ -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);