1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-28 14:16:41 +07:00

letting only to add tags

This commit is contained in:
Fedor Katurov 2019-10-09 16:30:52 +07:00
parent 9df5e022dd
commit 453f13f3db
5 changed files with 45 additions and 22 deletions

View file

@ -8,6 +8,7 @@ import {
nodeSetSendingComment,
nodeSetComments,
nodeSetCommentData,
nodeSetTags,
} from './actions';
import { INodeState } from './reducer';
@ -38,6 +39,9 @@ const setCommentData = (
{ id, comment }: ReturnType<typeof nodeSetCommentData>
) => assocPath(['comment_data', id], comment, state);
const setTags = (state: INodeState, { tags }: ReturnType<typeof nodeSetTags>) =>
assocPath(['current', 'tags'], tags, state);
export const NODE_HANDLERS = {
[NODE_ACTIONS.SAVE]: setSaveErrors,
[NODE_ACTIONS.SET_LOADING]: setLoading,
@ -46,4 +50,5 @@ export const NODE_HANDLERS = {
[NODE_ACTIONS.SET_SENDING_COMMENT]: setSendingComment,
[NODE_ACTIONS.SET_COMMENTS]: setComments,
[NODE_ACTIONS.SET_COMMENT_DATA]: setCommentData,
[NODE_ACTIONS.SET_TAGS]: setTags,
};