Skip to content

Commit

Permalink
Make threats optional in operational scenario schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Dec 10, 2024
1 parent fd2f719 commit ee87bf0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions frontend/src/lib/utils/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// schema for the validation of forms
import { description, threats } from '$paraglide/messages';
import { z, type AnyZodObject } from 'zod';

const toArrayPreprocessor = (value: unknown) => {
Expand Down Expand Up @@ -456,7 +455,7 @@ export const AttackPathSchema = z.object({
export const operationalScenarioSchema = z.object({
ebios_rm_study: z.string(),
attack_paths: z.string().uuid().array(),
threats: z.string().uuid().optional().array(),
threats: z.string().uuid().optional().array().optional(),
description: z.string(),
likelihood: z.number().optional().default(-1),
is_selected: z.boolean().optional().default(false),
Expand Down

0 comments on commit ee87bf0

Please sign in to comment.