Skip to content

Commit

Permalink
fix: deployment copy
Browse files Browse the repository at this point in the history
  • Loading branch information
robot9706 committed Dec 17, 2024
1 parent 04a1cf2 commit 3421b19
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions web/crux-ui/src/validations/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3421b19

Please sign in to comment.