feat(access-request): fix deleted policy interfering with the newest and valid policy and fix for default values on the creation form

This commit is contained in:
carlosmonastyrski
2025-05-29 17:43:47 -03:00
parent fe237fbf4a
commit 5af39b1a40
3 changed files with 28 additions and 5 deletions
@@ -45,7 +45,7 @@ const formSchema = z
environment: z.object({ slug: z.string(), name: z.string() }),
name: z.string().optional(),
secretPath: z.string().optional(),
approvals: z.number().min(1),
approvals: z.number().min(1).default(1),
userApprovers: z
.object({ type: z.literal(ApproverType.User), id: z.string() })
.array()
@@ -55,7 +55,7 @@ const formSchema = z
.array()
.default([]),
policyType: z.nativeEnum(PolicyType),
enforcementLevel: z.nativeEnum(EnforcementLevel),
enforcementLevel: z.nativeEnum(EnforcementLevel).default(EnforcementLevel.Hard),
allowedSelfApprovals: z.boolean().default(true)
})
.superRefine((data, ctx) => {