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