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

comment menu

This commit is contained in:
Fedor Katurov 2019-12-03 15:02:03 +07:00
parent ab898cc40c
commit 1bf9fe6b83
14 changed files with 319 additions and 98 deletions

View file

@ -12,9 +12,15 @@ import {
nodeSetEditor,
nodeSetCoverImage,
nodeSetRelated,
nodeSet,
} from './actions';
import { INodeState } from './reducer';
const setData = (state: INodeState, { node }: ReturnType<typeof nodeSet>) => ({
...state,
...node,
});
const setSaveErrors = (state: INodeState, { errors }: ReturnType<typeof nodeSetSaveErrors>) =>
assocPath(['errors'], errors, state);
@ -57,6 +63,7 @@ const setCoverImage = (
) => assocPath(['current_cover_image'], current_cover_image, state);
export const NODE_HANDLERS = {
[NODE_ACTIONS.SET]: setData,
[NODE_ACTIONS.SET_SAVE_ERRORS]: setSaveErrors,
[NODE_ACTIONS.SET_LOADING]: setLoading,
[NODE_ACTIONS.SET_LOADING_COMMENTS]: setLoadingComments,