This PR implements the search and filter mechanism as requested in issue #7. It adds the functionality to search for characters by name and filter them by homeworld, film, or species. The search and filter functionality is combined to provide accurate results. Additionally, integration tests have been added to ensure the correctness of the implementation.
Summary of Changes
Modified SearchFilter.tsx to include the filter state and its handler, and to use the onSearchChange prop.
Modified swapiService.tsx to include the filters in the API request for fetching characters.
Uncommented the filter dropdowns in SearchFilter.tsx and populated them with data from the API.
Added integration tests for the search and filter functionality in SearchFilter.test.tsx.
Added an integration test for testing the opening of CharacterModal with the correct person's information when CharacterCard is clicked in CharacterModal.test.tsx.
Please review and merge these changes at your earliest convenience.
Fixes #7.
๐ Latest improvements to Sweep:
Getting Sweep to run linters before committing! Check out Sweep Sandbox Configs to set it up.
Added support for self-hosting! Check out Self-hosting Sweep to get started.
[Self Hosting] Multiple options to compute vector embeddings, configure your .env file using VECTOR_EMBEDDING_SOURCE
๐ก To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
PR Feedback (click)
Description
This PR implements the search and filter mechanism as requested in issue #7. It adds the functionality to search for characters by name and filter them by homeworld, film, or species. The search and filter functionality is combined to provide accurate results. Additionally, integration tests have been added to ensure the correctness of the implementation.
Summary of Changes
SearchFilter.tsx
to include the filter state and its handler, and to use theonSearchChange
prop.swapiService.tsx
to include the filters in the API request for fetching characters.SearchFilter.tsx
and populated them with data from the API.SearchFilter.test.tsx
.CharacterModal
with the correct person's information whenCharacterCard
is clicked inCharacterModal.test.tsx
.Please review and merge these changes at your earliest convenience.
Fixes #7.
๐ Latest improvements to Sweep:
๐ก To get Sweep to edit this pull request, you can: