From 37475f7c1b1213d9cff061e5d3e5c5b1204dc6aa Mon Sep 17 00:00:00 2001 From: Charles Bochet Date: Mon, 2 Oct 2023 17:32:10 +0200 Subject: [PATCH] Fix bug non emptyable phones and urls --- front/src/modules/ui/field/meta-types/hooks/usePhoneField.ts | 2 +- front/src/modules/ui/field/meta-types/hooks/useURLField.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/front/src/modules/ui/field/meta-types/hooks/usePhoneField.ts b/front/src/modules/ui/field/meta-types/hooks/usePhoneField.ts index 58c4d0f0c..0d7130798 100644 --- a/front/src/modules/ui/field/meta-types/hooks/usePhoneField.ts +++ b/front/src/modules/ui/field/meta-types/hooks/usePhoneField.ts @@ -25,7 +25,7 @@ export const usePhoneField = () => { const persistField = usePersistField(); const persistPhoneField = (newPhoneValue: string) => { - if (!isPossiblePhoneNumber(newPhoneValue)) return; + if (!isPossiblePhoneNumber(newPhoneValue) && newPhoneValue !== '') return; persistField(newPhoneValue); }; diff --git a/front/src/modules/ui/field/meta-types/hooks/useURLField.ts b/front/src/modules/ui/field/meta-types/hooks/useURLField.ts index 7c79e0b46..c33b06f60 100644 --- a/front/src/modules/ui/field/meta-types/hooks/useURLField.ts +++ b/front/src/modules/ui/field/meta-types/hooks/useURLField.ts @@ -26,7 +26,7 @@ export const useURLField = () => { const persistField = usePersistField(); const persistURLField = (newValue: string) => { - if (!isURL(newValue)) { + if (!isURL(newValue) && newValue !== '') { return; }