Use the new history api on the front

This commit is contained in:
2023-05-23 17:10:58 +09:00
parent 3585c259a0
commit b80d4e20c1
5 changed files with 16 additions and 13 deletions
+3 -3
View File
@@ -331,10 +331,10 @@ export default class API {
* Retrieve a song's play history
* @param songId the id to find the song
*/
public static async getSongHistory(songId: number): Promise<SongHistory[]> {
public static async getSongHistory(songId: number): Promise<{best: number, history: SongHistory[]}> {
return API.fetch({
route: `/history`,
}).then((data: SongHistory[]) => data.filter((entry) => entry.songID == songId))
route: `/song${songId}/history`,
});
}
/**