fix: handle skip and slash in environment slug

This commit is contained in:
Salman
2024-03-15 20:21:27 +05:30
parent 3ae27e088f
commit ee2b8a594a
5 changed files with 27 additions and 14 deletions
@@ -16,7 +16,7 @@ type Props = {
const schema = yup.object({
environmentName: yup.string().label("Environment Name").required(),
environmentSlug: yup.string().label("Environment Slug").required()
environmentSlug: yup.string().label("Environment Slug").matches(/^[^./]*$/g, { message: "Invalid [.] or [/] not allowed"}).required()
});
export type FormData = yup.InferType<typeof schema>;
@@ -16,7 +16,7 @@ type Props = {
const schema = yup.object({
name: yup.string().label("Environment Name").required(),
slug: yup.string().label("Environment Slug").required()
slug: yup.string().label("Environment Slug").matches(/^[^./]*$/g, { message: "Invalid [.] or [/] not allowed"}).required()
});
export type FormData = yup.InferType<typeof schema>;