lint bro happ + test for getUserProject

This commit is contained in:
al8763be 2024-03-18 21:08:33 +01:00
parent 4392b68397
commit 8eb23bf7f9
6 changed files with 22 additions and 13 deletions

View file

@ -50,8 +50,8 @@ export default function GetWeeklyReport(): JSX.Element {
}
};
fetchWeeklyReport();
}, []);
void fetchWeeklyReport();
}, [projectName, token, username, week]);
const handleNewWeeklyReport = async (): Promise<void> => {
const newWeeklyReport: NewWeeklyReport = {

View file

@ -1,5 +1,5 @@
import { useState, useContext } from "react";
import { NewWeeklyReport } from "../Types/goTypes";
import type { NewWeeklyReport } from "../Types/goTypes";
import { api } from "../API/API";
import { useNavigate } from "react-router-dom";
import Button from "./Button";

View file

@ -9,7 +9,7 @@ const UserProjectListAdmin: React.FC = () => {
const fetchProjects = async (): Promise<void> => {
try {
const token = localStorage.getItem("accessToken") ?? "";
const username = getUsernameFromContext(); // Assuming you have a function to get the username from your context
const username = "NoUser"; // getUsernameFromContext(); // Assuming you have a function to get the username from your context
const response = await api.getUserProjects(username, token);
if (response.success) {