Merge branch 'frontend' into gruppDM

This commit is contained in:
Davenludd 2024-03-19 00:28:12 +01:00
commit 17c30f5dd9

View file

@ -42,10 +42,7 @@ interface API {
token: string,
): Promise<APIResponse<NewWeeklyReport>>;
/** Gets all the projects of a user*/
getUserProjects(
username: string,
token: string,
): Promise<APIResponse<Project[]>>;
getUserProjects(token: string): Promise<APIResponse<Project[]>>;
/** Gets a project from id*/
getProject(id: number): Promise<APIResponse<Project>>;
}
@ -150,10 +147,7 @@ export const api: API = {
}
},
async getUserProjects(
username: string,
token: string,
): Promise<APIResponse<Project[]>> {
async getUserProjects(token: string): Promise<APIResponse<Project[]>> {
try {
const response = await fetch("/api/getUserProjects", {
method: "GET",
@ -161,7 +155,6 @@ export const api: API = {
"Content-Type": "application/json",
Authorization: "Bearer " + token,
},
body: JSON.stringify({ username }),
});
if (!response.ok) {