Merge branch 'BumBranch' into gruppDM

This commit is contained in:
Davenludd 2024-03-20 15:21:26 +01:00
commit 847073c6f8
8 changed files with 182 additions and 31 deletions

View file

@ -49,7 +49,7 @@ interface API {
week: string,
token: string,
): Promise<APIResponse<WeeklyReport>>;
getWeeklyReportsForProject(
getWeeklyReportsForUser(
username: string,
projectName: string,
token: string,
@ -276,19 +276,18 @@ export const api: API = {
}
},
async getWeeklyReportsForProject(
async getWeeklyReportsForUser(
username: string,
projectName: string,
token: string,
): Promise<APIResponse<WeeklyReport[]>> {
try {
const response = await fetch("/api/getWeeklyReportsUser", {
const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + token,
},
body: JSON.stringify({ username, projectName }),
});
if (!response.ok) {