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:
parent
ab898cc40c
commit
1bf9fe6b83
14 changed files with 319 additions and 98 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue