From 2d0cc509a19155165dc6ef754d994328f8ce82e3 Mon Sep 17 00:00:00 2001 From: Aashish Date: Tue, 14 May 2024 16:45:48 +0530 Subject: [PATCH] fix: admin article edit --- client/src/pages/admin_v2/edit/[id].jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/pages/admin_v2/edit/[id].jsx b/client/src/pages/admin_v2/edit/[id].jsx index 1d8fe211..3e48dfa7 100644 --- a/client/src/pages/admin_v2/edit/[id].jsx +++ b/client/src/pages/admin_v2/edit/[id].jsx @@ -5,7 +5,7 @@ import Custom500 from '../../500'; import ActivityIndicator from '../../../components/shared/ActivityIndicator'; import { parseCookies } from 'nookies'; -import { getApolloLink, GraphClient } from '../../../config/ApolloClient'; +import { getGraphClient } from '../../../context/ApolloContextProvider'; import getRestrictedArticleData from '../../../graphql/queries/article/getRestrictedArticleData'; import listAllUser from '../../../graphql/queries/user/listAllUser'; import EditArticle from '../../../screens/admin_v2/Edit'; @@ -35,18 +35,18 @@ export async function getServerSideProps(context) { const id = context.params.id; const cookies = parseCookies(context); - GraphClient.setLink(getApolloLink(cookies.firebaseToken)); + const graphClient = getGraphClient(false, cookies.firebaseToken); const { data: { listAllUsers: allUsers }, - } = await GraphClient.query({ + } = await graphClient.query({ query: listAllUser, variables: { accountType: 2, limit: 10000 }, }); const { data: { getArticleByID: article }, - } = await GraphClient.query({ + } = await graphClient.query({ query: getRestrictedArticleData, variables: { id }, });