diff --git a/functions/api/inactivity/new.ts b/functions/api/inactivity/new.ts index f98c143..8795e30 100644 --- a/functions/api/inactivity/new.ts +++ b/functions/api/inactivity/new.ts @@ -1,7 +1,7 @@ import validateInactivity from "./validate.js"; export async function onRequestPost(context: RequestContext) { - const { departments, end, reason, start } = context.data.body; + const { departments, end, reason, senderTokenId, start } = context.data.body; const validationFailureResponse = validateInactivity( departments, @@ -24,11 +24,13 @@ export async function onRequestPost(context: RequestContext) { created_at: Date.now(), departments, end, + fcm_token: typeof senderTokenId === "string" ? senderTokenId : undefined, open: true, reason, start, user: { id: context.data.current_user.id, + email: context.data.current_user.email, username: context.data.current_user.username, }, }),