From 35d2a85030284dc2369be8dfac6da34798cc7586 Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Sun, 21 Jul 2024 21:07:09 +0300 Subject: [PATCH 1/3] Update error message when creating new document (Admin) --- src/components/admin/documents/Form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/documents/Form.tsx b/src/components/admin/documents/Form.tsx index 1c77ee3e9..f77bcbeb5 100644 --- a/src/components/admin/documents/Form.tsx +++ b/src/components/admin/documents/Form.tsx @@ -23,7 +23,7 @@ const validationSchema = yup .object() .defined() .shape({ - type: yup.string().oneOf(validDocumentTypes).required(), + type: yup.string().oneOf(validDocumentTypes, `Видът трябва да бъде една от следните стойности: ${validDocumentTypes.join(', ')}.s`).required(), name: yup.string().trim().min(2).max(20).required(), filename: yup.string().trim().min(2).max(20).required(), filetype: yup.string().trim().max(3), From 9e2c0281804416d848168f31afcf4adaf5d1d62b Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Sun, 21 Jul 2024 21:08:32 +0300 Subject: [PATCH 2/3] Remove symbol --- src/components/admin/documents/Form.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/documents/Form.tsx b/src/components/admin/documents/Form.tsx index f77bcbeb5..edd823fdf 100644 --- a/src/components/admin/documents/Form.tsx +++ b/src/components/admin/documents/Form.tsx @@ -23,7 +23,7 @@ const validationSchema = yup .object() .defined() .shape({ - type: yup.string().oneOf(validDocumentTypes, `Видът трябва да бъде една от следните стойности: ${validDocumentTypes.join(', ')}.s`).required(), + type: yup.string().oneOf(validDocumentTypes, `Видът трябва да бъде една от следните стойности: ${validDocumentTypes.join(', ')}.`).required(), name: yup.string().trim().min(2).max(20).required(), filename: yup.string().trim().min(2).max(20).required(), filetype: yup.string().trim().max(3), From a89c06aba09d116cfca6e60eea1a2a155db2007e Mon Sep 17 00:00:00 2001 From: ani-kalpachka Date: Sun, 21 Jul 2024 21:33:06 +0300 Subject: [PATCH 3/3] Update indentation to fix the build --- src/components/admin/documents/Form.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/admin/documents/Form.tsx b/src/components/admin/documents/Form.tsx index edd823fdf..11bdf8596 100644 --- a/src/components/admin/documents/Form.tsx +++ b/src/components/admin/documents/Form.tsx @@ -23,7 +23,13 @@ const validationSchema = yup .object() .defined() .shape({ - type: yup.string().oneOf(validDocumentTypes, `Видът трябва да бъде една от следните стойности: ${validDocumentTypes.join(', ')}.`).required(), + type: yup + .string() + .oneOf( + validDocumentTypes, + `Видът трябва да бъде една от следните стойности: ${validDocumentTypes.join(', ')}.`, + ) + .required(), name: yup.string().trim().min(2).max(20).required(), filename: yup.string().trim().min(2).max(20).required(), filetype: yup.string().trim().max(3),