Docs/Comments to DisplayUserProjects component
This commit is contained in:
parent
4212dae5bf
commit
aa5c4017bb
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,10 @@ import { Project } from "../Types/goTypes";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { api } from "../API/API";
|
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 {
|
function DisplayUserProject(): JSX.Element {
|
||||||
const [projects, setProjects] = useState<Project[]>([]);
|
const [projects, setProjects] = useState<Project[]>([]);
|
||||||
|
|
||||||
|
@ -16,6 +20,7 @@ function DisplayUserProject(): JSX.Element {
|
||||||
console.error(response.message);
|
console.error(response.message);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Call getProjects when the component mounts
|
// Call getProjects when the component mounts
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
void getProjects();
|
void getProjects();
|
||||||
|
|
Loading…
Add table
Reference in a new issue