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

storing flow cell view

This commit is contained in:
Fedor Katurov 2019-10-23 15:36:25 +07:00
parent 7254a448c1
commit 1d40eca79e
6 changed files with 26 additions and 7 deletions

View file

@ -4,13 +4,13 @@ import { FLOW_ACTIONS } from './constants';
import { getNodes } from '../node/api';
import { flowSetNodes, flowSetCellView } from './actions';
import { IResultWithStatus, INode } from '../types';
import { updateNodeEverywhere } from '../node/sagas';
import { selectFlowNodes } from './selectors';
import { reqWrapper } from '../auth/sagas';
import { postCellView } from './api';
function* onGetFlow() {
const {
data: { nodes = null },
error,
}: IResultWithStatus<{ nodes: INode[] }> = yield call(getNodes, {});
if (!nodes || !nodes.length) {
@ -24,6 +24,10 @@ function* onGetFlow() {
function* onSetCellView({ id, flow }: ReturnType<typeof flowSetCellView>) {
const nodes = yield select(selectFlowNodes);
yield put(flowSetNodes(nodes.map(node => (node.id === id ? { ...node, flow } : node))));
const { data, error } = yield call(reqWrapper, postCellView, { id, flow });
console.log({ data, error });
}
export default function* nodeSaga() {