Skip to content

Commit e654b63

Browse files
committed
feat Create session functionality & design
1 parent 626dc20 commit e654b63

File tree

3 files changed

+361
-138
lines changed

3 files changed

+361
-138
lines changed

src/Mutations/session.tsx

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import { gql } from '@apollo/client';
2+
3+
// Query to get a single session by ID
4+
export const GET_SESSION = gql`
5+
query GetSession($ID: ID!) {
6+
getSession(id: $ID) {
7+
id
8+
Sessionname
9+
description
10+
platform
11+
duration
12+
organizer
13+
}
14+
}
15+
`;
16+
17+
// Query to get a list of all sessions
18+
export const GET_SESSIONS = gql`
19+
query GetSessions {
20+
getAllSessions {
21+
id
22+
Sessionname
23+
description
24+
platform
25+
duration
26+
organizer
27+
}
28+
}
29+
`;
30+
31+
// Mutation to create a new session
32+
export const CREATE_SESSION = gql`
33+
mutation CreateSession($sessionInput: SessionInput) {
34+
createSession(sessionInput: $sessionInput) {
35+
id
36+
Sessionname
37+
description
38+
platform
39+
duration
40+
organizer
41+
}
42+
}
43+
`;
44+
45+
// Mutation to delete a session by ID
46+
export const DELETE_SESSION = gql`
47+
mutation DeleteSession($ID: ID!) {
48+
deleteSession(ID: $ID)
49+
}
50+
`;
51+
52+
// Mutation to edit/update a session by ID
53+
export const EDIT_SESSION = gql`
54+
mutation EditSession($ID: ID!, $editSessionInput: EditSessionInput) {
55+
editSession(ID: $ID, editSessionInput: $editSessionInput)
56+
}
57+
`;

src/containers/DashRoutes.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ const ManagersCards = React.lazy(() => import('../components/ManagerCard'));
7676
const CoordinatorCards = React.lazy(
7777
() => import('../components/CoordinatorCard'),
7878
);
79+
const AdminSission = React.lazy(() => import('./admin-dashBoard/Sessions'));
80+
7981

8082

8183
function DashRoutes() {
@@ -122,7 +124,7 @@ function DashRoutes() {
122124
<Route path="/cohorts" element={<AdminCohorts />} />
123125
<Route path="/phases" element={<AdminPhases />} />
124126
<Route path="/programs" element={<AdminPrograms />} />
125-
<Route path="/sessions" element={<AdminSession />} />
127+
<Route path="/sessions" element={<AdminSission />} />
126128
<Route path="/manage" element={<AdminManageRoles />} />
127129
<Route path="/grading" element={<GradingSystem />} />
128130
<Route

0 commit comments

Comments
 (0)