From 235c556f3d8035ad81f93a78c0828540fba44586 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Mon, 22 Jan 2024 01:22:01 +0800 Subject: [PATCH] :bug: Bug fixes with env --- src/scripts/requests.ts | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/scripts/requests.ts b/src/scripts/requests.ts index 0d75432..eff5976 100644 --- a/src/scripts/requests.ts +++ b/src/scripts/requests.ts @@ -1,15 +1,12 @@ export async function graphQuery(query: string, variables: any) { - const response = await fetch( - `${import.meta.env.PUBLIC_CMS}/api/graphql`, - { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ - query, - variables, - }), - } - ); + const response = await fetch(`${process.env.PUBLIC_CMS}/api/graphql`, { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ + query, + variables, + }), + }); return await response.json(); }