mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 19:43:16 +00:00
Delete expired invites
This commit is contained in:
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);
|
||||
},
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user