Frontend API interface fixed (untested) for getWeeklyReportsForUser

This commit is contained in:
Imbus 2024-03-20 17:10:11 +01:00
parent 649a4ba1fd
commit d19372d66b

View file

@ -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",