Skip to content

Commit

Permalink
trim trailing spaces (#6848)
Browse files Browse the repository at this point in the history
  • Loading branch information
AshrafMd-1 authored Dec 14, 2023
1 parent 56f0c2b commit 5b0bca7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Components/Users/UserAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export const UserAdd = (props: UserProps) => {
return;
case "first_name":
case "last_name":
state.form[field] = state.form[field].trim();
if (!state.form[field]) {
errors[field] = `${field
.split("_")
Expand Down Expand Up @@ -440,6 +441,7 @@ export const UserAdd = (props: UserProps) => {
}
return;
case "email":
state.form[field] = state.form[field].trim();
if (
state.form[field].length === 0 ||
!validateEmailAddress(state.form[field])
Expand Down

0 comments on commit 5b0bca7

Please sign in to comment.