mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 15:54:58 -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(
|
||||
req: NextApiRequest,
|
||||
res: NextApiResponse,
|
||||
res: NextApiResponse
|
||||
) {
|
||||
const { userId } = getAuth(req);
|
||||
|
||||
@ -53,7 +53,9 @@ export default async function handler(
|
||||
return;
|
||||
}
|
||||
if (data === null) {
|
||||
clerkClient.users.updateUserMetadata(userId, {
|
||||
await (
|
||||
await clerkClient()
|
||||
).users.updateUserMetadata(userId, {
|
||||
publicMetadata: { [type]: null },
|
||||
});
|
||||
res.status(200).send({ message: "Success" });
|
||||
@ -70,9 +72,10 @@ export default async function handler(
|
||||
if (type === "pad" && typeof data !== "number")
|
||||
return res.status(400).send({ message: "Couldn't find data" });
|
||||
|
||||
clerkClient.users.updateUserMetadata(userId, {
|
||||
publicMetadata: { [type]: typeof data === "number" ? data.toString() : data },
|
||||
(await clerkClient()).users.updateUserMetadata(userId, {
|
||||
publicMetadata: {
|
||||
[type]: typeof data === "number" ? data.toString() : data,
|
||||
},
|
||||
});
|
||||
res.status(200).send({ message: "Success" });
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user