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() { async getGenres() {
const response = await this.get("rest/getGenres", {}); const response = await this.get("rest/getGenres", {});
return response.genres.genre.map((item: any) => ({ return response.genres.genre
id: encodeURIComponent(item.value), .map((item: any) => ({
name: item.value, id: encodeURIComponent(item.value),
...item, name: item.value,
})); ...item,
}))
.sort((a: any, b:any) => a.name.localeCompare(b.name));;
} }
async getGenreDetails(id: string) { async getGenreDetails(id: string) {