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";
|
import validateInactivity from "./validate.js";
|
||||||
|
|
||||||
export async function onRequestPost(context: RequestContext) {
|
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(
|
const validationFailureResponse = validateInactivity(
|
||||||
departments,
|
departments,
|
||||||
@ -24,11 +24,13 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
departments,
|
departments,
|
||||||
end,
|
end,
|
||||||
|
fcm_token: typeof senderTokenId === "string" ? senderTokenId : undefined,
|
||||||
open: true,
|
open: true,
|
||||||
reason,
|
reason,
|
||||||
start,
|
start,
|
||||||
user: {
|
user: {
|
||||||
id: context.data.current_user.id,
|
id: context.data.current_user.id,
|
||||||
|
email: context.data.current_user.email,
|
||||||
username: context.data.current_user.username,
|
username: context.data.current_user.username,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user