Merge branch 'dev' into gruppDM

This commit is contained in:
Davenludd 2024-03-20 22:05:04 +01:00
commit f91f0ff8f5

View file

@ -87,14 +87,12 @@ interface API {
): Promise<APIResponse<NewWeeklyReport>>;
/** 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<APIResponse<WeeklyReport>>} 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<APIResponse<WeeklyReport>> {
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" };