mirror of
https://github.com/trafficlunar/tomodachi-share.git
synced 2026-06-28 14:44:15 +00:00
fix: allow admins to edit miis in api route
also fix build errors from last commit (don't trust `pnpm lint`)
This commit is contained in:
parent
2d82be8453
commit
783c5161c0
2 changed files with 4 additions and 3 deletions
|
|
@ -47,7 +47,8 @@ export async function PATCH(request: NextRequest, { params }: { params: Promise<
|
|||
});
|
||||
|
||||
if (!mii) return rateLimit.sendResponse({ error: "Mii not found" }, 404);
|
||||
if (Number(session.user.id) !== mii.userId) return rateLimit.sendResponse({ error: "You don't have ownership of that Mii" }, 403);
|
||||
if (!(Number(session.user.id) === mii.userId || Number(session.user.id) === Number(process.env.NEXT_PUBLIC_ADMIN_USER_ID)))
|
||||
return rateLimit.sendResponse({ error: "You don't have ownership of that Mii" }, 403);
|
||||
|
||||
// Parse form data
|
||||
const formData = await request.formData();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue