Store fcm token in report data
This commit is contained in:
parent
ea98d7d0de
commit
4978659bf9
@ -2,8 +2,15 @@ import { GenerateUploadURL } from "../../gcloud.js";
|
||||
import { jsonError, jsonResponse } from "../../common.js";
|
||||
|
||||
export async function onRequestPost(context: RequestContext) {
|
||||
const { actions, bypass, description, files, turnstileResponse, usernames } =
|
||||
context.data.body;
|
||||
const {
|
||||
actions,
|
||||
bypass,
|
||||
description,
|
||||
files,
|
||||
senderTokenId,
|
||||
turnstileResponse,
|
||||
usernames,
|
||||
} = context.data.body;
|
||||
|
||||
if (!context.data.current_user) {
|
||||
if (typeof turnstileResponse !== "string")
|
||||
@ -200,6 +207,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
JSON.stringify({
|
||||
attachments,
|
||||
created_at: Date.now(),
|
||||
fcm_token: typeof senderTokenId === "string" ? senderTokenId : undefined,
|
||||
id: reportId,
|
||||
open: !bypass,
|
||||
user: currentUser
|
||||
|
Loading…
x
Reference in New Issue
Block a user