From 3421b19032e81254e8d4d182b04bd2642903a423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20Nagygy=C3=B6rgy?= Date: Tue, 17 Dec 2024 09:01:41 +0100 Subject: [PATCH] fix: deployment copy --- web/crux-ui/src/validations/deployment.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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,