Skip to content

The open alternative to Salesforce, designed for AI.

Fix bug non emptyable phones and urls

Charles Bochet37475f7c1b12
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 58c4d0f0c5c..0d7130798ce 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 7c79e0b46bf..c33b06f60f9 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;
}