From cdd52004cda28c052befc748a22afbc76d479795 Mon Sep 17 00:00:00 2001 From: bobronaud Date: Sun, 5 May 2024 19:32:47 +0300 Subject: [PATCH] fix empty snippet name --- frontend/src/utils/validationSchemas.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/utils/validationSchemas.js b/frontend/src/utils/validationSchemas.js index 227841e5..a61d6653 100644 --- a/frontend/src/utils/validationSchemas.js +++ b/frontend/src/utils/validationSchemas.js @@ -48,4 +48,5 @@ export const snippetName = () => string() .required('errors.validation.requiredField') .max(SNIPPET_NAME_MAX_LENGTH, 'errors.validation.snippetNameMaxLength') - .matches(/^[a-zA-Z 0-9._-]*$/, 'errors.validation.singleWord'); + .matches(/^[a-zA-Z 0-9._-]*$/, 'errors.validation.singleWord') + .matches(/^(?!\s+$).+$/, 'errors.validation.requiredField');