mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-28 14:16:41 +07:00
comment rendering
This commit is contained in:
parent
398f44e232
commit
9531edcd19
10 changed files with 83 additions and 37 deletions
|
@ -7,6 +7,7 @@ import {
|
|||
nodeSetLoadingComments,
|
||||
nodeSetSendingComment,
|
||||
nodeSetComments,
|
||||
nodeSetCommentData,
|
||||
} from './actions';
|
||||
import { INodeState } from './reducer';
|
||||
|
||||
|
@ -32,6 +33,11 @@ const setSendingComment = (
|
|||
const setComments = (state: INodeState, { comments }: ReturnType<typeof nodeSetComments>) =>
|
||||
assocPath(['comments'], comments, state);
|
||||
|
||||
const setCommentData = (
|
||||
state: INodeState,
|
||||
{ comment_data }: ReturnType<typeof nodeSetCommentData>
|
||||
) => assocPath(['comment_data'], comment_data, state);
|
||||
|
||||
export const NODE_HANDLERS = {
|
||||
[NODE_ACTIONS.SAVE]: setSaveErrors,
|
||||
[NODE_ACTIONS.SET_LOADING]: setLoading,
|
||||
|
@ -39,4 +45,5 @@ export const NODE_HANDLERS = {
|
|||
[NODE_ACTIONS.SET_CURRENT]: setCurrent,
|
||||
[NODE_ACTIONS.SET_SENDING_COMMENT]: setSendingComment,
|
||||
[NODE_ACTIONS.SET_COMMENTS]: setComments,
|
||||
[NODE_ACTIONS.SET_COMMENT_DATA]: setCommentData,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue