Delete jams/content/judgements of user
This commit is contained in:
parent
fda1af7c18
commit
38da8c0a5d
1 changed files with 24 additions and 0 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue