Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add email and fcm token to inactivity notice data
  • Loading branch information
regalijan committed Oct 20, 2023
1 parent 4adae3a commit 6ea7fae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 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,
Expand All @@ -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,
},
}),
Expand Down

0 comments on commit 6ea7fae

Please sign in to comment.