Fixies in API and component code
This commit is contained in:
parent
caa793d036
commit
8084f722b5
2 changed files with 10 additions and 7 deletions
|
@ -282,13 +282,16 @@ export const api: API = {
|
|||
token: string,
|
||||
): Promise<APIResponse<WeeklyReport[]>> {
|
||||
try {
|
||||
const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, {
|
||||
const response = await fetch(
|
||||
`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: "Bearer " + token,
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
return {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue