Fixed getting the username and removed comment
This commit is contained in:
parent
d692165f99
commit
83e781c877
1 changed files with 1 additions and 2 deletions
|
@ -9,7 +9,7 @@ const UserProjectListAdmin: React.FC = () => {
|
||||||
const fetchProjects = async (): Promise<void> => {
|
const fetchProjects = async (): Promise<void> => {
|
||||||
try {
|
try {
|
||||||
const token = localStorage.getItem("accessToken") ?? "";
|
const token = localStorage.getItem("accessToken") ?? "";
|
||||||
const username = getUsernameFromContext(); // Assuming you have a function to get the username from your context
|
const username = localStorage.getItem("username") ?? "";
|
||||||
|
|
||||||
const response = await api.getUserProjects(username, token);
|
const response = await api.getUserProjects(username, token);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
|
@ -32,7 +32,6 @@ const UserProjectListAdmin: React.FC = () => {
|
||||||
{projects.map((project) => (
|
{projects.map((project) => (
|
||||||
<li key={project.id}>
|
<li key={project.id}>
|
||||||
<span>{project.name}</span>
|
<span>{project.name}</span>
|
||||||
{/* Add any additional project details you want to display */}
|
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue