mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-14 00:31:25 +10:00
feat: partial user platform support + statusMessage -> message
This commit is contained in:
@ -19,12 +19,12 @@ export default defineEventHandler(async (h3) => {
|
||||
if (userId === "system")
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Cannot interact with system user.",
|
||||
message: "Cannot interact with system user.",
|
||||
});
|
||||
|
||||
const user = await prisma.user.findUnique({ where: { id: userId } });
|
||||
if (!user)
|
||||
throw createError({ statusCode: 404, statusMessage: "User not found." });
|
||||
throw createError({ statusCode: 404, message: "User not found." });
|
||||
|
||||
await prisma.user.delete({ where: { id: userId } });
|
||||
return { success: true };
|
||||
|
||||
Reference in New Issue
Block a user