Skip to content

Conversation

ellazhuu
Copy link
Collaborator

@ellazhuu ellazhuu commented Sep 16, 2025

context: the search was including trailing spaces in its query. For instance, "history" and "history " returned different results.

fix: I called .trim() on the search term before passing it into the backend query. This removes spaces from both the beginning and end of words, but not the middle.

demo: previously, searching history with many trailing spaces would not return any matches because it was performing a literal search for those spaces. now, the two returns the same results.
Screenshot 2025-09-16 at 12 15 46 AM
Screenshot 2025-09-16 at 12 22 09 AM

Copy link

vercel bot commented Sep 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
pomonastudents Ready Ready Preview Comment Sep 16, 2025 7:20am

@ellazhuu ellazhuu requested review from haram082, ksantoso2 and PrinceBashangezi and removed request for haram082 September 16, 2025 07:21
@ellazhuu ellazhuu changed the title fix/different result for trailing spaces Fix/different result for trailing spaces Sep 16, 2025
Copy link
Collaborator

@ksantoso2 ksantoso2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants