From 16af90fd50d2a57cceb6894cf30a319100412e91 Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Tue, 22 Oct 2019 17:58:37 +0700 Subject: [PATCH] fetching node liked --- src/redux/node/api.ts | 4 +++- src/redux/node/sagas.ts | 2 +- src/redux/types.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/redux/node/api.ts b/src/redux/node/api.ts index b7c2e7cd..e8f6da65 100644 --- a/src/redux/node/api.ts +++ b/src/redux/node/api.ts @@ -28,11 +28,13 @@ export const getNodes = ({ export const getNode = ({ id, + access, }: { id: string | number; + access: string; }): Promise> => api - .get(API.NODE.GET_NODE(id)) + .get(API.NODE.GET_NODE(id), configWithToken(access)) .then(resultMiddleware) .catch(errorMiddleware); diff --git a/src/redux/node/sagas.ts b/src/redux/node/sagas.ts index 7200a9d8..2749d7fc 100644 --- a/src/redux/node/sagas.ts +++ b/src/redux/node/sagas.ts @@ -73,7 +73,7 @@ function* onNodeLoad({ id, node_type }: ReturnType) { const { data: { node, error }, - } = yield call(getNode, { id }); + } = yield call(reqWrapper, getNode, { id }); yield put(nodeSetLoading(false)); diff --git a/src/redux/types.ts b/src/redux/types.ts index a849deab..cd9e592a 100644 --- a/src/redux/types.ts +++ b/src/redux/types.ts @@ -119,6 +119,7 @@ export interface INode { blocks: IBlock[]; thumbnail?: string; description?: string; + is_liked?: boolean; options: { flow: {