Skip to content

Commit

Permalink
Allow null values in permisson data
Browse files Browse the repository at this point in the history
  • Loading branch information
razzeee committed Aug 18, 2024
1 parent 2d945c0 commit 1f7ff8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ModerationHeldEmail.PreviewProps = {
keys: {
shared: ["network"],
sockets: ["x11"],
filesystems: null,
},
current_values: {
shared: ["network", "ipc"],
Expand Down
2 changes: 2 additions & 0 deletions backend-node/emails/moderation-held.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ export interface Request {
| string[]
| boolean
| { [key: string]: string[] | { [key: string]: string[] } }
| null
}
current_values: {
[key: string]:
| string
| string[]
| boolean
| { [key: string]: string[] | { [key: string]: string[] } }
| null
}
}
isNewSubmission: boolean
Expand Down
4 changes: 4 additions & 0 deletions backend-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]),
),
}),
Expand Down

0 comments on commit 1f7ff8e

Please sign in to comment.