From 717e0930b21ce2db0e5c56f60896bed14f3d27a8 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sun, 22 Aug 2021 14:24:13 +0400 Subject: [PATCH] aa forget headers --- website/src/lib/backend-calls.ts | 4 ++++ website/src/screens/Account.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/website/src/lib/backend-calls.ts b/website/src/lib/backend-calls.ts index 2b19b46..d759fdf 100644 --- a/website/src/lib/backend-calls.ts +++ b/website/src/lib/backend-calls.ts @@ -13,6 +13,9 @@ async function accountApiFetch(url: string, method: "GET" | "POST" | "PUT" | "DE method, credentials: "include", ...body ? { + headers: { + "Content-Type": "application/json", + }, body: JSON.stringify(body), } : {}, }); @@ -28,6 +31,7 @@ export async function publishDictionary(): Promise } export async function upgradeAccount(password: string): Promise { + const response = await accountApiFetch("user/upgrade", "PUT", { password }); return response as AT.UpgradeUserResponse; } diff --git a/website/src/screens/Account.tsx b/website/src/screens/Account.tsx index 174f2ed..80b8dc8 100644 --- a/website/src/screens/Account.tsx +++ b/website/src/screens/Account.tsx @@ -124,7 +124,7 @@ const Account = ({ user, loadUser }: { user: AT.LingdocsUser | undefined, loadUs */}

Account Admin

- {user.level !== "basic" &&