Delete expired invites

This commit is contained in:
Rory& committed 2025-09-29 18:38:06 +02:00
1 parent 2620a55518
commit ba612ab2ba
2 files changed
+17 -2

No files matched your search

@@ -40,6 +40,12 @@ router.get(
relations: PublicInviteRelation,
});
await invites
.filter((i) => i.isExpired())
.forEachAsync(async (i) => {
await Invite.delete({ code: i.code });
});
return res.json(invites);
},
);