aa forget headers

This commit is contained in:
lingdocs 2021-08-22 14:24:13 +04:00
parent 2992a16871
commit 717e0930b2
2 changed files with 5 additions and 1 deletions

View File

@ -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<FT.PublishDictionaryResponse>
}
export async function upgradeAccount(password: string): Promise<AT.UpgradeUserResponse> {
const response = await accountApiFetch("user/upgrade", "PUT", { password });
return response as AT.UpgradeUserResponse;
}

View File

@ -124,7 +124,7 @@ const Account = ({ user, loadUser }: { user: AT.LingdocsUser | undefined, loadUs
</button> */}
<h4 className="mb-3">Account Admin</h4>
<div className="mb-4">
{user.level !== "basic" && <button
{user.level === "basic" && <button
type="button"
className="btn btn-outline-secondary mr-3 mb-3"
onClick={() => setShowingUpgradePrompt(true)}