feature: start to lay groundwork for reactions

This commit is contained in:
Andy Burke 2025-10-12 16:25:42 -07:00
parent 10b3e9ff72
commit 6500d9a9be
4 changed files with 56 additions and 5 deletions

View file

@ -128,7 +128,8 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
code: root_invite_code_secret,
creator_id: new_user_id,
timestamps: {
created: now
created: now,
expires: new Date(new Date(now).valueOf() + 1_000).toISOString()
}
};
@ -151,7 +152,7 @@ export async function POST(req: Request, meta: Record<string, any>): Promise<Res
code: secret_code
})).shift()?.load();
const is_expired = invite_code?.timestamps.expires ? now <= invite_code.timestamps.expires : false;
const is_expired = now >= (invite_code?.timestamps.expires ?? '0000-01-01T00:00:00.000Z');
const is_used = (await SIGNUPS.find({
referring_invite_code_id: invite_code?.id
}, {