From 70cf40feb55e6a4d3903b002ef143d1294377843 Mon Sep 17 00:00:00 2001 From: al8763be Date: Wed, 20 Mar 2024 22:02:34 +0100 Subject: [PATCH] fixed getWeeklyReport --- frontend/src/API/API.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index 47299f3..0859748 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -87,14 +87,12 @@ interface API { ): Promise>; /** Gets a weekly report for a specific user, project and week - * @param {string} username The username of the user. * @param {string} projectName The name of the project. * @param {string} week The week number. * @param {string} token The authentication token. * @returns {Promise>} A promise resolving to an API response with the retrieved report. */ getWeeklyReport( - username: string, projectName: string, week: string, token: string, @@ -319,20 +317,21 @@ export const api: API = { }, async getWeeklyReport( - username: string, projectName: string, week: string, token: string, ): Promise> { try { - const response = await fetch("/api/getWeeklyReport", { - method: "GET", - headers: { - "Content-Type": "application/json", - Authorization: "Bearer " + token, + const response = await fetch( + `/api/getWeeklyReport?projectName=${projectName}&week=${week}`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: "Bearer " + token, + }, }, - body: JSON.stringify({ username, projectName, week }), - }); + ); if (!response.ok) { return { success: false, message: "Failed to get weekly report" };