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

sagas for node creation dialog

This commit is contained in:
Fedor Katurov 2019-10-16 16:22:01 +07:00
parent 265b075ddc
commit 1b6a81d27c
11 changed files with 119 additions and 22 deletions

View file

@ -1,5 +1,5 @@
import { INode, IValidationErrors, IComment, ITag } from '../types';
import { NODE_ACTIONS } from './constants';
import { NODE_ACTIONS, NODE_TYPES } from './constants';
import { INodeState } from './reducer';
export const nodeSave = (node: INode) => ({
@ -64,3 +64,18 @@ export const nodeSetTags = (tags: ITag[]) => ({
type: NODE_ACTIONS.SET_TAGS,
tags,
});
export const nodeCreate = (node_type: INode['type']) => ({
type: NODE_ACTIONS.CREATE,
node_type,
});
export const nodeEdit = (id: INode['id']) => ({
type: NODE_ACTIONS.CREATE,
id,
});
export const nodeSetEditor = (editor: INode) => ({
type: NODE_ACTIONS.SET_EDITOR,
editor,
});