Some corrections
This commit is contained in:
parent
36524e5cbb
commit
d2ff2428cd
1 changed files with 5 additions and 5 deletions
|
@ -1,15 +1,15 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { api } from "../API/API";
|
||||
import { Project } from "../Types/goTypes";
|
||||
|
||||
const UserProjectListAdmin: React.FC = () => {
|
||||
function UserProjectListAdmin(props: { username: string }): JSX.Element {
|
||||
const [projects, setProjects] = useState<Project[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchProjects = async (): Promise<void> => {
|
||||
try {
|
||||
const token = localStorage.getItem("accessToken") ?? "";
|
||||
const username = localStorage.getItem("username") ?? "";
|
||||
const username = props.username;
|
||||
|
||||
const response = await api.getUserProjects(username, token);
|
||||
if (response.success) {
|
||||
|
@ -23,7 +23,7 @@ const UserProjectListAdmin: React.FC = () => {
|
|||
};
|
||||
|
||||
void fetchProjects();
|
||||
}, []);
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
@ -37,6 +37,6 @@ const UserProjectListAdmin: React.FC = () => {
|
|||
</ul>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default UserProjectListAdmin;
|
||||
|
|
Loading…
Reference in a new issue