Skip to content

Commit

Permalink
feat Create session functionality & design
Browse files Browse the repository at this point in the history
  • Loading branch information
NTElissa committed Nov 14, 2023
1 parent 626dc20 commit e654b63
Show file tree
Hide file tree
Showing 3 changed files with 361 additions and 138 deletions.
57 changes: 57 additions & 0 deletions src/Mutations/session.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { gql } from '@apollo/client';

// Query to get a single session by ID
export const GET_SESSION = gql`
query GetSession($ID: ID!) {
getSession(id: $ID) {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Query to get a list of all sessions
export const GET_SESSIONS = gql`
query GetSessions {
getAllSessions {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Mutation to create a new session
export const CREATE_SESSION = gql`
mutation CreateSession($sessionInput: SessionInput) {
createSession(sessionInput: $sessionInput) {
id
Sessionname
description
platform
duration
organizer
}
}
`;

// Mutation to delete a session by ID
export const DELETE_SESSION = gql`
mutation DeleteSession($ID: ID!) {
deleteSession(ID: $ID)
}
`;

// Mutation to edit/update a session by ID
export const EDIT_SESSION = gql`
mutation EditSession($ID: ID!, $editSessionInput: EditSessionInput) {
editSession(ID: $ID, editSessionInput: $editSessionInput)
}
`;
4 changes: 3 additions & 1 deletion src/containers/DashRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const ManagersCards = React.lazy(() => import('../components/ManagerCard'));
const CoordinatorCards = React.lazy(
() => import('../components/CoordinatorCard'),
);
const AdminSission = React.lazy(() => import('./admin-dashBoard/Sessions'));



function DashRoutes() {
Expand Down Expand Up @@ -122,7 +124,7 @@ function DashRoutes() {
<Route path="/cohorts" element={<AdminCohorts />} />
<Route path="/phases" element={<AdminPhases />} />
<Route path="/programs" element={<AdminPrograms />} />
<Route path="/sessions" element={<AdminSession />} />
<Route path="/sessions" element={<AdminSission />} />
<Route path="/manage" element={<AdminManageRoles />} />
<Route path="/grading" element={<GradingSystem />} />
<Route
Expand Down
Loading

0 comments on commit e654b63

Please sign in to comment.