sort genres by name

This commit is contained in:
Thomas Amland 2020-07-27 14:37:17 +02:00
parent 7ec1cac749
commit 5bca8cd69c

View File

@ -48,11 +48,13 @@ export class API {
async getGenres() {
const response = await this.get("rest/getGenres", {});
return response.genres.genre.map((item: any) => ({
id: encodeURIComponent(item.value),
name: item.value,
...item,
}));
return response.genres.genre
.map((item: any) => ({
id: encodeURIComponent(item.value),
name: item.value,
...item,
}))
.sort((a: any, b:any) => a.name.localeCompare(b.name));;
}
async getGenreDetails(id: string) {