Răsfoiți Sursa

provide read only values for defaults (#4019)

ianedwards 2 ani în urmă
părinte
comite
71cef4932e
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      dashboard/src/lib/porter-apps/values.ts

+ 3 - 3
dashboard/src/lib/porter-apps/values.ts

@@ -2,21 +2,21 @@ import { z } from "zod";
 
 // ServiceString is a string value in a service that can be read-only or editable
 export const serviceStringValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.string(),
 });
 export type ServiceString = z.infer<typeof serviceStringValidator>;
 
 // ServiceNumber is a number value in a service that can be read-only or editable
 export const serviceNumberValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.coerce.number(),
 });
 export type ServiceNumber = z.infer<typeof serviceNumberValidator>;
 
 // ServiceBoolean is a boolean value in a service that can be read-only or editable
 export const serviceBooleanValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.boolean(),
 });
 export type ServiceBoolean = z.infer<typeof serviceBooleanValidator>;