From d19372d66bcc6fb82e2f10eb0ffc7be75400b2ff Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 20 Mar 2024 17:10:11 +0100 Subject: [PATCH] Frontend API interface fixed (untested) for getWeeklyReportsForUser --- frontend/src/API/API.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index 6a508b5..bcd22eb 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -49,6 +49,14 @@ interface API { week: string, token: string, ): Promise<APIResponse<WeeklyReport>>; + /** + * Returns all the weekly reports for a user in a particular project + * The username is derived from the token + * + * @param {string} projectName The name of the project + * @param {string} token The token of the user + * @returns {APIResponse<WeeklyReport[]>} A list of weekly reports + */ getWeeklyReportsForUser( username: string, projectName: string, @@ -275,12 +283,11 @@ export const api: API = { }, async getWeeklyReportsForUser( - username: string, projectName: string, token: string, ): Promise<APIResponse<WeeklyReport[]>> { try { - const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, { + const response = await fetch(`/api/getWeeklyReportsUser/${projectName}`, { method: "GET", headers: { "Content-Type": "application/json",