mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-01 03:18:06 +03:00
fix: always sort invites by TOU
This commit is contained in:
@@ -22,9 +22,16 @@ router.use(RequireSelfRequestFromUser);
|
||||
router.get("/", async (req, res) => {
|
||||
const user = GetTachiData(req, "requestedUser");
|
||||
|
||||
const invites = await db.invites.find({
|
||||
createdBy: user.id,
|
||||
});
|
||||
const invites = await db.invites.find(
|
||||
{
|
||||
createdBy: user.id,
|
||||
},
|
||||
{
|
||||
sort: {
|
||||
consumedAt: -1,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
const consumers = await GetUsersWithIDs(
|
||||
invites.map((e) => e.consumedBy).filter((e) => e !== null) as Array<number>
|
||||
|
||||
Reference in New Issue
Block a user