Minor fixes

This commit is contained in:
Mattias 2024-03-20 14:17:21 +01:00
parent 0fb06790af
commit 47ce986834

View file

@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { NewWeeklyReport } from "../Types/goTypes";
import { WeeklyReport, NewWeeklyReport } from "../Types/goTypes";
import { api } from "../API/API";
import { useNavigate, useParams } from "react-router-dom";
import Button from "./Button";
@ -31,8 +31,10 @@ export default function GetWeeklyReport(): JSX.Element {
);
if (response.success) {
const report: NewWeeklyReport = response.data ?? {
projectName: "",
const report: WeeklyReport = response.data ?? {
reportId: 0,
userId: 0,
projectId: 0,
week: 0,
developmentTime: 0,
meetingTime: 0,
@ -41,7 +43,6 @@ export default function GetWeeklyReport(): JSX.Element {
studyTime: 0,
testingTime: 0,
};
setWeek(report.week);
setDevelopmentTime(report.developmentTime);
setMeetingTime(report.meetingTime);