Docs/Comments to DisplayUserProjects component

This commit is contained in:
Davenludd 2024-03-20 13:54:13 +01:00
parent 4212dae5bf
commit aa5c4017bb

View file

@ -3,6 +3,10 @@ import { Project } from "../Types/goTypes";
import { Link } from "react-router-dom";
import { api } from "../API/API";
/**
* Renders a component that displays the projects a user is a part of and links to the projects start-page.
* @returns The JSX element representing the component.
*/
function DisplayUserProject(): JSX.Element {
const [projects, setProjects] = useState<Project[]>([]);
@ -16,6 +20,7 @@ function DisplayUserProject(): JSX.Element {
console.error(response.message);
}
};
// Call getProjects when the component mounts
useEffect(() => {
void getProjects();