Delete jams/content/judgements of user

This commit is contained in:
MeowcaTheoRange 2024-04-25 14:44:36 -05:00
parent fda1af7c18
commit 38da8c0a5d

View file

@ -160,6 +160,30 @@ export async function DELETE(request: NextRequest, {params}: {params: {user:stri
status: 401
});
try {
await db
.deleteFrom('jams')
.where('jams.author_id', '=', deletingUser.id)
.execute();
} catch (err) {
}
try {
await db
.deleteFrom('content')
.where('content.author_id', '=', deletingUser.id)
.execute();
} catch (err) {
}
try {
await db
.deleteFrom('judgements')
.where('judgements.author_id', '=', deletingUser.id)
.execute();
} catch (err) {
}
try {
await db
.deleteFrom('users')