From 14c5296c15472516aa95e8883a49b911a809b6bd Mon Sep 17 00:00:00 2001 From: javiersuweijie Date: Sun, 27 Oct 2024 14:55:14 +0800 Subject: [PATCH] fix: replace - with _ --- packages/app/src/app/submit/form.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/app/src/app/submit/form.ts b/packages/app/src/app/submit/form.ts index ed748b5..7cbe6b2 100644 --- a/packages/app/src/app/submit/form.ts +++ b/packages/app/src/app/submit/form.ts @@ -54,9 +54,9 @@ export const formSchema = z.object({ if (value.includes(' ')) { ctx.addIssue({ code: 'custom', - message: 'Warning: Name contains spaces. They will be replaced with underscores.', + message: 'Warning: Name contains spaces or dashes. They will be replaced with underscores.', }); - return value.replace(/ /g, '_'); + return value.replace(/[ -]/g, '_'); } return value; }),