feat(search view v2): update API.searchSongs

This commit is contained in:
Amaury Danis Cousandier
2024-01-13 10:00:59 +01:00
parent 131d7bf688
commit f2ad34c8ab
4 changed files with 19 additions and 8 deletions
+3 -2
View File
@@ -705,6 +705,7 @@ export default class API {
public static searchSongs(query: searchProps): Query<Song[]> {
const queryParams: string[] = [];
if (query.query) queryParams.push(`q=${encodeURIComponent(query.query)}`);
if (query.artist) queryParams.push(`artistId=${query.artist}`);
if (query.genre) queryParams.push(`genreId=${query.genre}`);
@@ -715,13 +716,13 @@ export default class API {
exec: () => {
return API.fetch(
{
route: `/search/songs/${query.query}${queryString}`,
route: `/search/songs${queryString}`,
},
{ handler: ListHandler(SongHandler) }
);
},
};
}
}
public static getPartitionMelodyUrl(songId: number): string {
return `${API.baseUrl}/song/${songId}/assets/melody`;