Contact: Forbid to save contact without a name (#2803)
This commit is contained in:
parent
bfbd9bd2ed
commit
3ea4f4d3ed
@ -101,7 +101,11 @@ const ManageUser: FC<OwnProps & StateProps> = ({
|
|||||||
const handleFirstNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
const handleFirstNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
||||||
setFirstName(e.target.value);
|
setFirstName(e.target.value);
|
||||||
setIsProfileFieldsTouched(true);
|
setIsProfileFieldsTouched(true);
|
||||||
}, []);
|
|
||||||
|
if (error === ERROR_FIRST_NAME_MISSING) {
|
||||||
|
setError(undefined);
|
||||||
|
}
|
||||||
|
}, [error]);
|
||||||
|
|
||||||
const handleLastNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
const handleLastNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
||||||
setLastName(e.target.value);
|
setLastName(e.target.value);
|
||||||
@ -119,6 +123,7 @@ const ManageUser: FC<OwnProps & StateProps> = ({
|
|||||||
|
|
||||||
if (!trimmedFirstName.length) {
|
if (!trimmedFirstName.length) {
|
||||||
setError(ERROR_FIRST_NAME_MISSING);
|
setError(ERROR_FIRST_NAME_MISSING);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateContact({
|
updateContact({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user