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

adding comments

This commit is contained in:
muerwre 2019-08-26 15:37:11 +07:00
parent c541278686
commit 76a3331719
14 changed files with 148 additions and 26 deletions

View file

@ -1,4 +1,4 @@
import { INode, IValidationErrors } from '../types';
import { INode, IValidationErrors, IComment } from '../types';
import { NODE_ACTIONS } from './constants';
import { INodeState } from './reducer';
@ -32,3 +32,19 @@ export const nodeSetCurrent = (current: INodeState['current']) => ({
current,
type: NODE_ACTIONS.SET_CURRENT,
});
export const nodePostComment = (data: IComment, id: INode['id']) => ({
data,
id,
type: NODE_ACTIONS.POST_COMMENT,
});
export const nodeSetSendingComment = (is_sending_comment: boolean) => ({
is_sending_comment,
type: NODE_ACTIONS.SET_SENDING_COMMENT,
});
export const nodeSetComments = (comments: IComment[]) => ({
comments,
type: NODE_ACTIONS.SET_COMMENTS,
});