feat(handle-project): enhance project name validation to disallow starting with a number

This commit is contained in:
Mauricio Siu 2025-04-04 01:27:53 -06:00
parent 031d0ce315
commit 8479f20205

View File

@ -31,9 +31,14 @@ import { toast } from "sonner";
import { z } from "zod";
const AddProjectSchema = z.object({
name: z.string().min(1, {
message: "Name is required",
}),
name: z
.string()
.min(1, {
message: "Name is required",
})
.regex(/^[a-zA-Z]/, {
message: "Project name cannot start with a number",
}),
description: z.string().optional(),
});
@ -97,18 +102,6 @@ export const HandleProject = ({ projectId }: Props) => {
);
});
};
// useEffect(() => {
// const getUsers = async () => {
// const users = await authClient.admin.listUsers({
// query: {
// limit: 100,
// },
// });
// console.log(users);
// };
// getUsers();
// });
return (
<Dialog open={isOpen} onOpenChange={setIsOpen}>