mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-01-31 15:37:09 +01:00
feat(invitations): completed admin UI, with minor changes to backend
This commit is contained in:
20
server/tasks/cleanup/invitations.ts
Normal file
20
server/tasks/cleanup/invitations.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import prisma from "~/server/internal/db/database";
|
||||
|
||||
export default defineTask({
|
||||
meta: {
|
||||
name: "cleanup:invitations",
|
||||
},
|
||||
async run({}) {
|
||||
const now = new Date();
|
||||
|
||||
await prisma.invitation.deleteMany({
|
||||
where: {
|
||||
expires: {
|
||||
lt: now,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return { result: true };
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user