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

#34 made submitting comment form

This commit is contained in:
Fedor Katurov 2021-02-27 18:11:38 +07:00
parent 051b199d5d
commit dad416e6e2
6 changed files with 97 additions and 65 deletions

View file

@ -1,5 +1,5 @@
import { INode, IValidationErrors, IComment, ITag, IFile } from '../types';
import { NODE_ACTIONS, NODE_TYPES } from './constants';
import { IComment, IFile, INode, ITag, IValidationErrors } from '../types';
import { NODE_ACTIONS } from './constants';
import { INodeState } from './reducer';
export const nodeSet = (node: Partial<INodeState>) => ({
@ -50,6 +50,17 @@ export const nodePostComment = (id: number, is_before: boolean) => ({
type: NODE_ACTIONS.POST_COMMENT,
});
export const nodePostLocalComment = (
nodeId: INode['id'],
comment: IComment,
callback: (e?: string) => void
) => ({
nodeId,
comment,
callback,
type: NODE_ACTIONS.POST_LOCAL_COMMENT,
});
export const nodeCancelCommentEdit = (id: number) => ({
id,
type: NODE_ACTIONS.CANCEL_COMMENT_EDIT,