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

showing comments left count

This commit is contained in:
Fedor Katurov 2020-04-09 13:48:26 +07:00
parent 911beea4ad
commit 319e66616c
9 changed files with 101 additions and 115 deletions

View file

@ -3,6 +3,7 @@ import { INode, IResultWithStatus, IComment } from '../types';
import { API } from '~/constants/api';
import { nodeUpdateTags, nodeLike, nodeStar, nodeLock, nodeLockComment } from './actions';
import { INodeState } from './reducer';
import { COMMENTS_DISPLAY } from './constants';
export const postNode = ({
access,
@ -95,14 +96,16 @@ export const postNodeComment = ({
export const getNodeComments = ({
id,
access,
order = 'ASC',
take = COMMENTS_DISPLAY,
skip = 0,
}: {
id: number;
access: string;
order: 'ASC' | 'DESC';
take?: number;
skip?: number;
}): Promise<IResultWithStatus<{ comments: Comment[] }>> =>
api
.get(API.NODE.COMMENT(id), configWithToken(access, { params: { order } }))
.get(API.NODE.COMMENT(id), configWithToken(access, { params: { take, skip } }))
.then(resultMiddleware)
.catch(errorMiddleware);