aa forget headers
This commit is contained in:
parent
2992a16871
commit
717e0930b2
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)}
|
||||
|
|
Loading…
Reference in New Issue