diff --git a/apps/frontend/src/components/CurrentJobs.tsx b/apps/frontend/src/components/CurrentJobs.tsx index 60c9dca..bebd2b6 100644 --- a/apps/frontend/src/components/CurrentJobs.tsx +++ b/apps/frontend/src/components/CurrentJobs.tsx @@ -1,4 +1,23 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +import api from '../lib/axiosConfig'; +import { Task } from './tasks-dto'; + export default function CurrentJobs() { + const [tasks, setTasks] = useState([]); + + const onGetData = () => { + api.get('/tasks').then((res) => { + setTasks(res.data); + }); + }; + + useEffect(() => { + onGetData(); + }, []); + return (
@@ -15,36 +34,17 @@ export default function CurrentJobs() { - - Felelős pozíciók - . - - - Projektmunkák - . - - - - Tanfolyam/mentorálás - - . - - - . - . - - - . - . - - - . - . - - - . - . - + {tasks.map((task) => ( + + + {task.description} + + . + + ))}
diff --git a/apps/frontend/src/components/tasks-dto.tsx b/apps/frontend/src/components/tasks-dto.tsx new file mode 100644 index 0000000..0ead6bf --- /dev/null +++ b/apps/frontend/src/components/tasks-dto.tsx @@ -0,0 +1,8 @@ +export type Task = { + id: number; + description: string; + sprintId: number; + userId: number; + projektId: number; + createdAt: Date; +};