Add email and fcm token to inactivity notice data
This commit is contained in:
parent
4adae3af51
commit
6ea7fae377
@ -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,
|
||||
},
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user