Просмотр исходного кода

provide read only values for defaults (#4019)

ianedwards 2 лет назад
Родитель
Сommit
71cef4932e
1 измененных файлов с 3 добавлено и 3 удалено
  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
 // ServiceString is a string value in a service that can be read-only or editable
 export const serviceStringValidator = z.object({
 export const serviceStringValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.string(),
   value: z.string(),
 });
 });
 export type ServiceString = z.infer<typeof serviceStringValidator>;
 export type ServiceString = z.infer<typeof serviceStringValidator>;
 
 
 // ServiceNumber is a number value in a service that can be read-only or editable
 // ServiceNumber is a number value in a service that can be read-only or editable
 export const serviceNumberValidator = z.object({
 export const serviceNumberValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.coerce.number(),
   value: z.coerce.number(),
 });
 });
 export type ServiceNumber = z.infer<typeof serviceNumberValidator>;
 export type ServiceNumber = z.infer<typeof serviceNumberValidator>;
 
 
 // ServiceBoolean is a boolean value in a service that can be read-only or editable
 // ServiceBoolean is a boolean value in a service that can be read-only or editable
 export const serviceBooleanValidator = z.object({
 export const serviceBooleanValidator = z.object({
-  readOnly: z.boolean(),
+  readOnly: z.boolean().default(false),
   value: z.boolean(),
   value: z.boolean(),
 });
 });
 export type ServiceBoolean = z.infer<typeof serviceBooleanValidator>;
 export type ServiceBoolean = z.infer<typeof serviceBooleanValidator>;