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

added 404 to node loading process

This commit is contained in:
Fedor Katurov 2019-11-07 18:40:10 +07:00
parent c9a730dd15
commit 6b6ed48ce2

View file

@ -99,7 +99,7 @@ function* onNodeGoto({ id, node_type }: ReturnType<typeof nodeGotoNode>) {
function* onNodeLoad({ id }: ReturnType<typeof nodeLoadNode>) {
yield put(nodeSetLoading(true));
yield put(nodeSetLoadingComments(true));
yield put(nodeSetSaveErrors({}));
// yield put(nodeSetSaveErrors({}));
yield put(nodeSetCommentData(0, { ...EMPTY_COMMENT }));
yield put(nodeSetRelated(null));
@ -107,15 +107,13 @@ function* onNodeLoad({ id }: ReturnType<typeof nodeLoadNode>) {
data: { node, error },
} = yield call(reqWrapper, getNode, { id });
if (error) {
yield put(nodeSetSaveErrors({ error }));
if (error || !node || !node.id) {
yield put(push(URLS.ERRORS.NOT_FOUND));
yield put(nodeSetLoading(false));
return;
}
yield put(nodeSetSaveErrors({}));
yield put(nodeSetCurrent(node));
yield put(nodeSetLoading(false));
const {