From d1e369f723ca80fc3427231db87fa26c4a0e2869 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Sun, 13 Oct 2019 16:45:42 +0700 Subject: [PATCH] optional comment view authentifiction --- src/redux/node/api.ts | 4 +++- src/redux/node/sagas.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/redux/node/api.ts b/src/redux/node/api.ts index 40a0dc03..2e0d37fe 100644 --- a/src/redux/node/api.ts +++ b/src/redux/node/api.ts @@ -51,11 +51,13 @@ export const postNodeComment = ({ export const getNodeComments = ({ id, + access, }: { id: number; + access: string; }): Promise> => api - .get(API.NODE.COMMENT(id)) + .get(API.NODE.COMMENT(id), configWithToken(access)) .then(resultMiddleware) .catch(errorMiddleware); diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index e246c752..98fe0693 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -72,7 +72,7 @@ function* onNodeLoad({ id, node_type }: ReturnType) { // todo: load comments const { data: { comments }, - } = yield call(getNodeComments, { id }); + } = yield call(reqWrapper, getNodeComments, { id }); yield put(nodeSetComments(comments || []));