Fixies in API and component code

This commit is contained in:
Davenludd 2024-03-20 15:32:30 +01:00
parent caa793d036
commit 8084f722b5
2 changed files with 10 additions and 7 deletions

View file

@ -282,13 +282,16 @@ export const api: API = {
token: string,
): Promise<APIResponse<WeeklyReport[]>> {
try {
const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, {
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + token,
const response = await fetch(
`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + token,
},
},
});
);
if (!response.ok) {
return {

View file

@ -15,7 +15,7 @@ function AllTimeReportsInProject(): JSX.Element {
const getWeeklyReports = async (): Promise<void> => {
const token = localStorage.getItem("accessToken") ?? "";
const response = await api.getWeeklyReportsForProject(
const response = await api.getWeeklyReportsForUser(
localStorage.getItem("username") ?? "",
projectName ?? "",
token,