1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

node liking

This commit is contained in:
Fedor Katurov 2019-10-23 11:35:04 +07:00
parent 34e449dd15
commit fea0a37457
4 changed files with 64 additions and 3 deletions

View file

@ -75,3 +75,14 @@ export const updateNodeTags = ({
.post(API.NODE.UPDATE_TAGS(id), { tags }, configWithToken(access))
.then(resultMiddleware)
.catch(errorMiddleware);
export const postNodeLike = ({
id,
access,
}: ReturnType<typeof nodeUpdateTags> & { access: string }): Promise<
IResultWithStatus<{ is_liked: INode['is_liked'] }>
> =>
api
.post(API.NODE.POST_LIKE(id), {}, configWithToken(access))
.then(resultMiddleware)
.catch(errorMiddleware);