Skip to content

Commit 221f574

Browse files
committed
feat: Add page of all training sessions
1 parent d2f14db commit 221f574

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/app/training/(dashboard)/TrainingSideNav.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const TrainingSideNav: React.FC<TrainingSideNavProps> = ({ notifications
4444
},
4545
{ title: 'Student Profile', route: 'profile' },
4646
{ title: 'Mentor Profile', route: 'mentor' },
47+
{ title: 'All Sessions', route: 'all' },
4748
],
4849
},
4950
]}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { type NextPage } from 'next';
2+
import { fetchApi } from '@/utils/fetch';
3+
import { type TrainingSession } from '@/types/training';
4+
import { SessionsTable } from '../SessionsTable';
5+
6+
async function getTrainingSessions(): Promise<TrainingSession[]> {
7+
return fetchApi(
8+
'/training/sessions/all/',
9+
{ cache: 'no-store' },
10+
);
11+
}
12+
13+
const AllSessions: NextPage = async () => {
14+
const trainingSessions = await getTrainingSessions();
15+
16+
return <SessionsTable data={trainingSessions} />;
17+
};
18+
19+
export default AllSessions;

0 commit comments

Comments
 (0)