From dbbe4da4014cc0271a5c9428f5ce7b0d42f9322c Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Thu, 21 Mar 2024 18:05:41 +0100 Subject: [PATCH] Fix for submitWeeklyReport ts API --- frontend/src/API/API.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/API/API.ts b/frontend/src/API/API.ts index 5c49a8d..c6cef66 100644 --- a/frontend/src/API/API.ts +++ b/frontend/src/API/API.ts @@ -85,7 +85,7 @@ interface API { submitWeeklyReport( weeklyReport: NewWeeklyReport, token: string, - ): Promise>; + ): Promise>; /** Gets a weekly report for a specific user, project and week * @param {string} projectName The name of the project. @@ -294,7 +294,7 @@ export const api: API = { async submitWeeklyReport( weeklyReport: NewWeeklyReport, token: string, - ): Promise> { + ): Promise> { try { const response = await fetch("/api/submitWeeklyReport", { method: "POST", @@ -312,8 +312,8 @@ export const api: API = { }; } - const data = (await response.json()) as NewWeeklyReport; - return { success: true, data }; + const data = await response.text(); + return { success: true, message: data }; } catch (e) { return { success: false,