diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index f8d3e5c..16aebff 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -99,16 +99,20 @@ interface API { token: string, ): Promise>; - /** Gets a weekly report for a specific user, project and week + /** Gets a weekly report for a specific user, project and week. + * Keep in mind that the user within the token needs to be PM + * of the project to get the report, unless the user is the target user. * @param {string} projectName The name of the project. * @param {string} week The week number. * @param {string} token The authentication token. + * @param {string} targetUser The username of the target user. Defaults to token user. * @returns {Promise>} A promise resolving to an API response with the retrieved report. */ getWeeklyReport( projectName: string, week: string, token: string, + targetUser?: string, ): Promise>; /** @@ -529,10 +533,11 @@ export const api: API = { projectName: string, week: string, token: string, + targetUser?: string, ): Promise> { try { const response = await fetch( - `/api/getWeeklyReport?projectName=${projectName}&week=${week}`, + `/api/getWeeklyReport?projectName=${projectName}&week=${week}&targetUser=${targetUser}`, { method: "GET", headers: {