fix(genreselector): fix searching in Genre filter (#3468)

pull/3478/head
Salman Tariq 2 years ago committed by GitHub
parent f33eb862fd
commit d7fa35e066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) => ({
return results.data
.map((result) => ({
label: result.name,
value: result.id,
}));
}))
.filter(({ label }) =>
label.toLowerCase().includes(inputValue.toLowerCase())
);
};
return (

Loading…
Cancel
Save