mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
setting nodes on flow\
This commit is contained in:
parent
4a7fe884f9
commit
4c49ed000a
4 changed files with 16 additions and 9 deletions
|
@ -1,23 +1,25 @@
|
|||
import { takeLatest, call } from 'redux-saga/effects';
|
||||
import { takeLatest, call, put } from 'redux-saga/effects';
|
||||
import { REHYDRATE } from 'redux-persist';
|
||||
import { FLOW_ACTIONS } from './constants';
|
||||
import { getNodes } from '../node/api';
|
||||
import { flowSetNodes } from './actions';
|
||||
import { objFromArray } from '~/utils/fn';
|
||||
import { IResultWithStatus, INode } from '../types';
|
||||
|
||||
function* onGetFlow() {
|
||||
const {
|
||||
data: { nodes = null },
|
||||
error,
|
||||
} = yield call(getNodes, {});
|
||||
}: IResultWithStatus<{ nodes: INode[] }> = yield call(getNodes, {});
|
||||
|
||||
if (!nodes) {
|
||||
if (!nodes || !nodes.length) {
|
||||
// todo: set error empty response
|
||||
}
|
||||
|
||||
// todo: write nodes
|
||||
// yield put(flowSetNodes());
|
||||
yield put(flowSetNodes(nodes));
|
||||
|
||||
console.log('flow', { nodes, error });
|
||||
// console.log('flow', { nodes, error });
|
||||
}
|
||||
|
||||
export default function* nodeSaga() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue