From 6da7387aecf156426f4a64ff68819a7225a5e5bf Mon Sep 17 00:00:00 2001 From: "Au Chen Xi, Gabriel" Date: Mon, 13 Nov 2023 18:51:18 +0800 Subject: [PATCH] Revert "Switch to use utils" This reverts commit 17997c87659be68f9b44b253d719378e54e419e0. --- src/hooks/useAIComm.ts | 2 +- src/hooks/useSessionComm.ts | 2 +- src/pages/maintainer/environments.tsx | 2 +- src/pages/questions/index.tsx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hooks/useAIComm.ts b/src/hooks/useAIComm.ts index b50f0a0..9011bbc 100644 --- a/src/hooks/useAIComm.ts +++ b/src/hooks/useAIComm.ts @@ -23,7 +23,7 @@ export default function useAIComm( isAIResponding: false, }); - const utils = api.useUtils(); + const utils = api.useContext(); const allSessionMessages = api.userAndAIMessages.getAllSessionUserAndAIMessages.useQuery({ diff --git a/src/hooks/useSessionComm.ts b/src/hooks/useSessionComm.ts index 1c11dcd..c82bf72 100644 --- a/src/hooks/useSessionComm.ts +++ b/src/hooks/useSessionComm.ts @@ -24,7 +24,7 @@ export default function useSessionComm( partnerIsTyping: false, }); - const utils = api.useUtils(); + const utils = api.useContext(); const allSessionMessages = api.userAndUserMessages.getAllSessionUserAndUserMessages.useQuery({ diff --git a/src/pages/maintainer/environments.tsx b/src/pages/maintainer/environments.tsx index ea0641b..829df37 100644 --- a/src/pages/maintainer/environments.tsx +++ b/src/pages/maintainer/environments.tsx @@ -111,7 +111,7 @@ const CreateEnvironment = () => { })); }; - const apiContext = api.useUtils(); + const apiContext = api.useContext(); const updateEnvMutation = api.environment.upsertEnvironment.useMutation( { diff --git a/src/pages/questions/index.tsx b/src/pages/questions/index.tsx index 4844f4b..156ca9b 100644 --- a/src/pages/questions/index.tsx +++ b/src/pages/questions/index.tsx @@ -24,7 +24,7 @@ function Questions() { const [page, setPage] = useState(0); - const getAllQuery = api.useUtils().question.getAllReducedInfinite; + const getAllQuery = api.useContext().question.getAllReducedInfinite; const { data,