Skip to content

Commit

Permalink
safe db call for remove user
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohan29997 committed Apr 11, 2023
1 parent 5c60bd3 commit 6071d9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/database-watermelon/src/dao/user_dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export class UserDao extends BaseDao<DbUserModel> {
}

async deleteUser(data: { email: string }): Promise<boolean> {
await this.attachedDatabase.write(async () => {
await safeDbCall(this.attachedDatabase.write(async () => {
const response: any = await this.databaseData.query(Q.where('email', Q.eq(data.email))).destroyAllPermanently()
return response
})
}))
return true
}
}

0 comments on commit 6071d9c

Please sign in to comment.