Front: Merge

This commit is contained in:
Arthur Jamet
2023-04-25 15:55:50 +01:00
21 changed files with 588 additions and 330 deletions

View File

@@ -388,15 +388,10 @@ export default class API {
/**
* Retrieve the authenticated user's play history
*/
public static async getUserPlayHistory(): Promise<Song[]> {
const queryClient = new QueryClient();
let songs = await queryClient.fetchQuery(
["API", "allsongs"],
API.getAllSongs
);
const shuffled = [...songs].sort(() => 0.5 - Math.random());
return shuffled.slice(0, 3);
public static async getUserPlayHistory(): Promise<SongHistory[]> {
return this.fetch({
route: '/history'
});
}
/**