mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added 404 to node loading process
This commit is contained in:
parent
c9a730dd15
commit
6b6ed48ce2
1 changed files with 3 additions and 5 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue