From 1f7ff8eb6286ff9cf0e79e1630e2b932d08e46dd Mon Sep 17 00:00:00 2001 From: Razze Date: Sun, 18 Aug 2024 16:23:28 +0200 Subject: [PATCH] Allow null values in permisson data --- .../emails/moderation-held-permission-object-removal.tsx | 1 + backend-node/emails/moderation-held.tsx | 2 ++ backend-node/src/index.ts | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/backend-node/emails/moderation-held-permission-object-removal.tsx b/backend-node/emails/moderation-held-permission-object-removal.tsx index 56e568de4..4ce46f3ca 100644 --- a/backend-node/emails/moderation-held-permission-object-removal.tsx +++ b/backend-node/emails/moderation-held-permission-object-removal.tsx @@ -15,6 +15,7 @@ ModerationHeldEmail.PreviewProps = { keys: { shared: ["network"], sockets: ["x11"], + filesystems: null, }, current_values: { shared: ["network", "ipc"], diff --git a/backend-node/emails/moderation-held.tsx b/backend-node/emails/moderation-held.tsx index 74a48891a..c9ad427ff 100644 --- a/backend-node/emails/moderation-held.tsx +++ b/backend-node/emails/moderation-held.tsx @@ -39,6 +39,7 @@ export interface Request { | string[] | boolean | { [key: string]: string[] | { [key: string]: string[] } } + | null } current_values: { [key: string]: @@ -46,6 +47,7 @@ export interface Request { | string[] | boolean | { [key: string]: string[] | { [key: string]: string[] } } + | null } } isNewSubmission: boolean diff --git a/backend-node/src/index.ts b/backend-node/src/index.ts index 6382b4966..a16c343b5 100644 --- a/backend-node/src/index.ts +++ b/backend-node/src/index.ts @@ -22,19 +22,23 @@ const RequestSchema = z.object({ requestType: z.literal("appdata"), requestData: z.object({ keys: z.record( + z.string(), z.union([ z.string(), z.array(z.string()), z.boolean(), z.record(z.union([z.array(z.string()), z.record(z.array(z.string()))])), + z.null(), ]), ), current_values: z.record( + z.string(), z.union([ z.string(), z.array(z.string()), z.boolean(), z.record(z.union([z.array(z.string()), z.record(z.array(z.string()))])), + z.null(), ]), ), }),