Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for [#247] search bar not working when in /torrents endpoint #251

Conversation

mario-nt
Copy link
Contributor

@mario-nt mario-nt commented Sep 2, 2023

Fixes #247

The search bar was not working when in the /torrents endpoint, because the watcher listening for changes in the url path was not triggering when the user searches for a specific torrent.

@mario-nt mario-nt closed this Sep 4, 2023
@mario-nt mario-nt deleted the #247-search-bar-not-working-when-in-/torrents-endpoint branch September 4, 2023 15:38
@mario-nt mario-nt restored the #247-search-bar-not-working-when-in-/torrents-endpoint branch September 4, 2023 15:39
@mario-nt mario-nt reopened this Sep 4, 2023
@josecelano josecelano self-requested a review September 4, 2023 15:45
Copy link
Member

@josecelano josecelano left a comment

Choose a reason for hiding this comment

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

Hi @mario-nt, It works, but we are making unnecessary requests.

image

The request to get the torrents is made four times.

@josecelano
Copy link
Member

Hi @mario-nt I've tested it, and it works. Tests are failing because the Tracker container image has changed, and we need to update the docker-compose configuration as I'm doing on the Index Backend.

I've created a new issue: #262

I will finish that issue, then I will do the same here in this repo, and finally, we can re-run tests in this PR. If everything is OK I will merge it.

@josecelano josecelano closed this Sep 11, 2023
@josecelano
Copy link
Member

I clicked on Close with a comment instead of Comment :-(

@josecelano josecelano reopened this Sep 11, 2023
MMelchor added 2 commits September 12, 2023 13:51
Using the search bar in the /torrents endpoint, now actually calls the API to fetch the torrents
with the search query and displays the result, making the torrents component render again with
the results matching the search prompt.

A key was added to the <NuxtPage> component so the watcher listening for a new search prompt gets triggered. Also,
minor refactoring was applied to the code to follow  good practices and clean up unused imports and variables.
…oint

Code has been refactor and now looks cleaner and easier to understand.
@mario-nt mario-nt force-pushed the #247-search-bar-not-working-when-in-/torrents-endpoint branch from b900217 to 6c72733 Compare September 12, 2023 11:52
@mario-nt
Copy link
Contributor Author

Rebase and tests OK, ready to be reviewed @josecelano .

@josecelano
Copy link
Member

ACK 6c72733

@josecelano josecelano merged commit 67a7bcd into torrust:develop Sep 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Search bar not working when in /torrents endpoint
2 participants