Skip to content

Commit

Permalink
Fix bug non emptyable phones and urls
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesBochet committed Oct 2, 2023
1 parent 965a6b7 commit 37475f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down
2 changes: 1 addition & 1 deletion front/src/modules/ui/field/meta-types/hooks/useURLField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useURLField = () => {
const persistField = usePersistField();

const persistURLField = (newValue: string) => {
if (!isURL(newValue)) {
if (!isURL(newValue) && newValue !== '') {
return;
}

Expand Down

0 comments on commit 37475f7

Please sign in to comment.