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

fixed pushing tags

This commit is contained in:
Fedor Katurov 2019-10-24 12:43:54 +07:00
parent 6836e00de1
commit 99426172b2
12 changed files with 79 additions and 22 deletions

View file

@ -1,4 +1,4 @@
import { takeLatest, call, put, select, delay } from 'redux-saga/effects';
import { takeLatest, call, put, select, delay, all } from 'redux-saga/effects';
import { push } from 'connected-react-router';
import { NODE_ACTIONS, EMPTY_NODE, EMPTY_COMMENT, NODE_EDITOR_DATA } from './constants';
@ -19,6 +19,7 @@ import {
nodeSetEditor,
nodeEdit,
nodeLike,
nodeSetRelated,
} from './actions';
import {
postNode,
@ -28,6 +29,7 @@ import {
updateNodeTags,
postNodeLike,
postNodeStar,
getNodeRelated,
} from './api';
import { reqWrapper } from '../auth/sagas';
import { flowSetNodes } from '../flow/actions';
@ -112,11 +114,19 @@ function* onNodeLoad({ id, node_type }: ReturnType<typeof nodeLoadNode>) {
// todo: load comments
const {
data: { comments },
} = yield call(reqWrapper, getNodeComments, { id });
comments: {
data: { comments },
},
related: {
data: { related },
},
} = yield all({
comments: call(reqWrapper, getNodeComments, { id }),
related: call(reqWrapper, getNodeRelated, { id }),
});
yield put(nodeSetComments(comments || []));
yield put(nodeSetRelated(related || []));
yield put(nodeSetLoadingComments(false));
return;