fix: update regex to allow number at the end of app name

This commit is contained in:
Bima42
2025-12-26 13:26:23 +01:00
parent e4384075f2
commit 2df1b42540

View File

@@ -54,9 +54,9 @@ const AddComposeSchema = z.object({
.min(1, {
message: "App name is required",
})
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z])?$/, {
.regex(/^[a-z](?!.*--)([a-z0-9-]*[a-z0-9])?$/, {
message:
"App name supports lowercase letters, numbers, '-' and can only start and end letters, and does not support continuous '-'",
"App name supports lowercase letters, numbers, '-' and must start with a letter, end with a letter or number, and cannot contain consecutive '-'",
}),
description: z.string().optional(),
serverId: z.string().optional(),
@@ -78,9 +78,6 @@ export const AddCompose = ({ environmentId, projectName }: Props) => {
const { mutateAsync, isLoading, error, isError } =
api.compose.create.useMutation();
// Get environment data to extract projectId
const { data: environment } = api.environment.one.useQuery({ environmentId });
const hasServers = servers && servers.length > 0;
// Show dropdown logic based on cloud environment
// Cloud: show only if there are remote servers (no Dokploy option)