Repository navigation
fix: Update search page when changing terms - #2992
Merged
lucasfp13 merged 1 commit intoSep 1, 2025
Merged
Conversation
lucasfp13
requested review from
eduardoformiga and
ommeirelles
and removed request for
a team
August 14, 2025 17:57
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
lucasfp13
commented
Aug 14, 2025
| }) | ||
|
|
||
| const shouldFetch = | ||
| !hasSameVariables || shouldFetchFirstPage || !!sessionPostalCode |
Contributor
Author
There was a problem hiding this comment.
I changed this line (adding the !!sessionPostalCode)
lucasfp13
commented
Aug 14, 2025
| const shouldFetch = | ||
| !hasSameVariables || shouldFetchFirstPage || !!sessionPostalCode | ||
|
|
||
| const { data, mutate } = useQuery< |
Contributor
Author
There was a problem hiding this comment.
I changed this line (adding the mutate)
lucasfp13
commented
Aug 14, 2025
Comment on lines
+156
to
+162
| // Refetch query with updated regionId | ||
| useEffect(() => { | ||
| if (sessionPostalCode !== postalCodeRef.current) { | ||
| mutate() | ||
| postalCodeRef.current = sessionPostalCode | ||
| } | ||
| }, [sessionPostalCode]) |
Contributor
Author
There was a problem hiding this comment.
I changed this line (adding the useEffect to refetch the query)
lariciamota
approved these changes
Aug 29, 2025
lucasfp13
deleted the
fix/SFS-2764-update-search-page-when-changing-terms
branch
September 1, 2025 12:14
lariciamota
added a commit
that referenced
this pull request
Sep 4, 2025
This reverts commit 90be90f.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
Currently, after performing a new search, when the shopper is already in the search page, the results are not changing. Also, the results are not being updated when the zip code is changed.
With these changes, the search page will consider the correct term when performing the search and will refetch the query when the zip code is changed.
How to test it?
apple. You should seeappleresults;unbrandedand the results should be different (showing results forunbranded);Starters Deploy Preview
dp-faststore-org/vendemo-dp#74
vtex-sites/faststoreqa.store#857
References