Skip to content

Commit

Permalink
delete collections on user delete
Browse files Browse the repository at this point in the history
  • Loading branch information
sspenst committed Apr 5, 2024
1 parent ccb740d commit b8a1821
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pages/api/user/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export default withAuth({

await Promise.all([
AchievementModel.deleteMany({ userId: req.userId }, { session: session }),
CollectionModel.deleteMany({ userId: req.userId }, { session: session }),
DeviceModel.deleteMany({ userId: req.userId }, { session: session }),
GraphModel.deleteMany({ $or: [{ source: req.userId }, { target: req.userId }] }, { session: session }),
// delete in keyvaluemodel where key contains userId
Expand Down

0 comments on commit b8a1821

Please sign in to comment.