Skip to content

Commit

Permalink
fix: handle if there is no user
Browse files Browse the repository at this point in the history
  • Loading branch information
Vann-Dev committed May 6, 2024
1 parent 9269101 commit 6ca2f99
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/routes/account/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ async def delete_account(id):

await db.connect()

await db.user.delete_many(
userAvailable = await db.user.find_first(
where={
"account_id": id
}
)

if userAvailable:
await db.user.delete_many(
where={
"account_id": id
}
)

data = await db.account.delete(
where={
Expand Down

0 comments on commit 6ca2f99

Please sign in to comment.