From 566208204887d785a4a56f1c322b44d83b322615 Mon Sep 17 00:00:00 2001 From: Arthur Jamet Date: Thu, 4 May 2023 11:40:39 +0100 Subject: [PATCH] Front: Get Song History: Actually use API --- front/API.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/front/API.ts b/front/API.ts index e3b6c2d..9b9c776 100644 --- a/front/API.ts +++ b/front/API.ts @@ -331,11 +331,9 @@ export default class API { * @param songId the id to find the song */ public static async getSongHistory(songId: number): Promise { - return [67, 4578, 2, 9990].map((value) => ({ - songId: songId, - userId: 1, - score: value, - })); + return API.fetch({ + route: `/history`, + }).then((data: SongHistory[]) => data.filter((entry) => entry.songID == songId)) } /**