Skip to content

Commit

Permalink
fix(genreselector): fix searching in Genre filter (#3468)
Browse files Browse the repository at this point in the history
  • Loading branch information
SalmanTariq committed May 31, 2023
1 parent f33eb86 commit d7fa35e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/Selector/index.tsx
Expand Up @@ -169,15 +169,19 @@ export const GenreSelector = ({
loadDefaultGenre();
}, [defaultValue, type]);

const loadGenreOptions = async () => {
const loadGenreOptions = async (inputValue: string) => {
const results = await axios.get<GenreSliderItem[]>(
`/api/v1/discover/genreslider/${type}`
);

return results.data.map((result) => ({
label: result.name,
value: result.id,
}));
return results.data
.map((result) => ({
label: result.name,
value: result.id,
}))
.filter(({ label }) =>
label.toLowerCase().includes(inputValue.toLowerCase())
);
};

return (
Expand Down

0 comments on commit d7fa35e

Please sign in to comment.