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";
|
import { jsonError, jsonResponse } from "../../common.js";
|
||||||
|
|
||||||
export async function onRequestPost(context: RequestContext) {
|
export async function onRequestPost(context: RequestContext) {
|
||||||
const { actions, bypass, description, files, turnstileResponse, usernames } =
|
const {
|
||||||
context.data.body;
|
actions,
|
||||||
|
bypass,
|
||||||
|
description,
|
||||||
|
files,
|
||||||
|
senderTokenId,
|
||||||
|
turnstileResponse,
|
||||||
|
usernames,
|
||||||
|
} = context.data.body;
|
||||||
|
|
||||||
if (!context.data.current_user) {
|
if (!context.data.current_user) {
|
||||||
if (typeof turnstileResponse !== "string")
|
if (typeof turnstileResponse !== "string")
|
||||||
@ -200,6 +207,7 @@ export async function onRequestPost(context: RequestContext) {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
attachments,
|
attachments,
|
||||||
created_at: Date.now(),
|
created_at: Date.now(),
|
||||||
|
fcm_token: typeof senderTokenId === "string" ? senderTokenId : undefined,
|
||||||
id: reportId,
|
id: reportId,
|
||||||
open: !bypass,
|
open: !bypass,
|
||||||
user: currentUser
|
user: currentUser
|
||||||
|
Loading…
x
Reference in New Issue
Block a user