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,
|
token: string,
|
||||||
): Promise<APIResponse<WeeklyReport[]>> {
|
): Promise<APIResponse<WeeklyReport[]>> {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`, {
|
const response = await fetch(
|
||||||
method: "GET",
|
`/api/getWeeklyReportsUser?username=${username}&projectName=${projectName}`,
|
||||||
headers: {
|
{
|
||||||
"Content-Type": "application/json",
|
method: "GET",
|
||||||
Authorization: "Bearer " + token,
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
Authorization: "Bearer " + token,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -15,7 +15,7 @@ function AllTimeReportsInProject(): JSX.Element {
|
||||||
|
|
||||||
const getWeeklyReports = async (): Promise<void> => {
|
const getWeeklyReports = async (): Promise<void> => {
|
||||||
const token = localStorage.getItem("accessToken") ?? "";
|
const token = localStorage.getItem("accessToken") ?? "";
|
||||||
const response = await api.getWeeklyReportsForProject(
|
const response = await api.getWeeklyReportsForUser(
|
||||||
localStorage.getItem("username") ?? "",
|
localStorage.getItem("username") ?? "",
|
||||||
projectName ?? "",
|
projectName ?? "",
|
||||||
token,
|
token,
|
||||||
|
|
Loading…
Add table
Reference in a new issue