diff --git a/web/crux-ui/src/validations/deployment.ts b/web/crux-ui/src/validations/deployment.ts index 88f9eeca7..48d853e80 100644 --- a/web/crux-ui/src/validations/deployment.ts +++ b/web/crux-ui/src/validations/deployment.ts @@ -9,19 +9,28 @@ export const prefixRule = yup .required() .label('common:prefix') -export const updateDeploymentSchema = yup.object().shape({ +const baseDeploymentSchema = yup.object().shape({ note: yup.string().optional().nullable().label('common:note'), prefix: prefixRule, - protected: yup.bool().required(), }) +export const updateDeploymentSchema = baseDeploymentSchema.concat( + yup.object().shape({ + protected: yup.bool().required(), + }), +) + export const createDeploymentSchema = updateDeploymentSchema.concat( yup.object().shape({ nodeId: yup.mixed().nullable().required().label('common:node'), }), ) -export const copyDeploymentSchema = createDeploymentSchema +export const copyDeploymentSchema = baseDeploymentSchema.concat( + yup.object().shape({ + nodeId: yup.mixed().nullable().required().label('common:node'), + }), +) export const createDeploymentTokenSchema = yup.object().shape({ name: nameRule,