Skip to content

Commit

Permalink
Login as: trim user input before sending it to server
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksTeresh committed Mar 21, 2024
1 parent 7a30417 commit e2dcfde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/containers/Person/components/PersonSwitcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class PersonSwitcher extends Component {
};

handleChange = debounce(async (ev) => {
const query = ev.target.value
if (query.length < 5) return
const query = ev.target.value && ev.target.value.trim()
if (!query || query.length < 5) return

const { data } = await callApi(`/persons/search?search=${query}`)
const results = data
Expand Down

0 comments on commit e2dcfde

Please sign in to comment.