mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 22:14:59 -05:00
fix: forgot one api endpoint
This commit is contained in:
parent
10e0c91d6a
commit
be3c0f749a
@ -33,7 +33,7 @@ import { clerkClient, getAuth } from "@clerk/nextjs/server";
|
|||||||
|
|
||||||
export default async function handler(
|
export default async function handler(
|
||||||
req: NextApiRequest,
|
req: NextApiRequest,
|
||||||
res: NextApiResponse,
|
res: NextApiResponse
|
||||||
) {
|
) {
|
||||||
const { userId } = getAuth(req);
|
const { userId } = getAuth(req);
|
||||||
|
|
||||||
@ -53,7 +53,9 @@ export default async function handler(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data === null) {
|
if (data === null) {
|
||||||
clerkClient.users.updateUserMetadata(userId, {
|
await (
|
||||||
|
await clerkClient()
|
||||||
|
).users.updateUserMetadata(userId, {
|
||||||
publicMetadata: { [type]: null },
|
publicMetadata: { [type]: null },
|
||||||
});
|
});
|
||||||
res.status(200).send({ message: "Success" });
|
res.status(200).send({ message: "Success" });
|
||||||
@ -70,9 +72,10 @@ export default async function handler(
|
|||||||
if (type === "pad" && typeof data !== "number")
|
if (type === "pad" && typeof data !== "number")
|
||||||
return res.status(400).send({ message: "Couldn't find data" });
|
return res.status(400).send({ message: "Couldn't find data" });
|
||||||
|
|
||||||
clerkClient.users.updateUserMetadata(userId, {
|
(await clerkClient()).users.updateUserMetadata(userId, {
|
||||||
publicMetadata: { [type]: typeof data === "number" ? data.toString() : data },
|
publicMetadata: {
|
||||||
|
[type]: typeof data === "number" ? data.toString() : data,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
res.status(200).send({ message: "Success" });
|
res.status(200).send({ message: "Success" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user