Merge branch 'BumBranch' into gruppDM

This commit is contained in:
Davenludd 2024-03-20 14:02:11 +01:00
commit 4574af25cb

View file

@ -48,7 +48,7 @@ interface API {
projectName: string, projectName: string,
week: string, week: string,
token: string, token: string,
): Promise<APIResponse<NewWeeklyReport>>; ): Promise<APIResponse<WeeklyReport>>;
getWeeklyReportsForProject( getWeeklyReportsForProject(
username: string, username: string,
projectName: string, projectName: string,
@ -254,7 +254,7 @@ export const api: API = {
projectName: string, projectName: string,
week: string, week: string,
token: string, token: string,
): Promise<APIResponse<NewWeeklyReport>> { ): Promise<APIResponse<WeeklyReport>> {
try { try {
const response = await fetch("/api/getWeeklyReport", { const response = await fetch("/api/getWeeklyReport", {
method: "GET", method: "GET",
@ -268,7 +268,7 @@ export const api: API = {
if (!response.ok) { if (!response.ok) {
return { success: false, message: "Failed to get weekly report" }; return { success: false, message: "Failed to get weekly report" };
} else { } else {
const data = (await response.json()) as NewWeeklyReport; const data = (await response.json()) as WeeklyReport;
return { success: true, data }; return { success: true, data };
} }
} catch (e) { } catch (e) {
@ -279,8 +279,8 @@ export const api: API = {
async getWeeklyReportsForProject( async getWeeklyReportsForProject(
username: string, username: string,
projectName: string, projectName: string,
token: string, token: string
) { ): Promise<APIResponse<WeeklyReport[]>> {
try { try {
const response = await fetch("/api/getWeeklyReportsUser", { const response = await fetch("/api/getWeeklyReportsUser", {
method: "GET", method: "GET",