mirror of
https://github.com/mosh-hamedani/helpdesk.git
synced 2026-05-21 11:58:19 +02:00
Handle edge cases
This commit is contained in:
parent
ed22c0ff88
commit
c07dc68159
|
|
@ -121,6 +121,11 @@ router.delete("/:id", requireAuth, requireAdmin, async (req, res) => {
|
|||
data: { deletedAt: new Date() },
|
||||
});
|
||||
|
||||
await prisma.ticket.updateMany({
|
||||
where: { assignedToId: id },
|
||||
data: { assignedToId: null },
|
||||
});
|
||||
|
||||
await prisma.session.deleteMany({ where: { userId: id } });
|
||||
|
||||
res.json({ message: "User deleted" });
|
||||
|
|
|
|||
Loading…
Reference in a new issue