Add validation to org slug

This commit is contained in:
Tuan Dang
2024-02-07 09:39:06 -08:00
parent fc7015de83
commit 9011394c34
3 changed files with 23 additions and 5 deletions
@@ -10,7 +10,11 @@ import { OrgPermissionActions, OrgPermissionSubjects, useOrganization } from "@a
import { useUpdateOrg } from "@app/hooks/api";
const formSchema = yup.object({
slug: yup.string().required().label("Project Slug")
slug: yup
.string()
.matches(/^[a-zA-Z0-9-]+$/, "Name must only contain alphanumeric characters or hyphens")
.required()
.label("Project Slug")
});
type FormData = yup.InferType<typeof formSchema>;