Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a moderator-facing teachers moderation flow: backend adds moderator-specific teachers endpoints and restricts public teacher visibility to “active”, while the frontend adds moderator routing/UI to review teacher profiles and change statuses.
Changes:
- Backend: add moderator endpoints to list/get teachers; restrict public teacher listing/detail to
status === "active". - Frontend: add
/moderatorprivate routes + sidebar menu; add UI controls to change teacher status. - Frontend: add moderator APIs/hooks and optimistic update utilities for status changes.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/types/teacher/teacher.types.ts | Adds moderator query input type for teacher listing. |
| server/src/routes/teacherRoute.ts | Adds moderator-only teachers routes. |
| server/src/repositories/queryRepositories/teacher.query.ts | Splits “active-only” public listing and adds moderator listing method. |
| server/src/controllers/teacher.controller.ts | Uses active-only listing for public; adds moderator list/detail handlers; hides non-active teacher detail publicly. |
| client/src/util/statusButtons.tsx | Adds UI mapping + class builder for status buttons. |
| client/src/util/patchTeachersList.util.ts | Adds helpers to patch teacher status in cached lists. |
| client/src/store/authSession.store.ts | Extends account type to include moderator. |
| client/src/router/routesVariables/pathVariables.ts | Adds moderator base path + moderator private route variables. |
| client/src/router/routesVariables/moderatorPrivateRoutes.tsx | Defines moderator private routes (teachers + teacher detail + chat). |
| client/src/router/router.tsx | Adds /moderator protected route section. |
| client/src/router/RoleIndexRedirect.tsx | Redirects users to role-specific home, including moderator. |
| client/src/pages/teacherDetail/teacherDetail.tsx | Enables status moderation controls when on moderator routes. |
| client/src/pages/moderatorTeachersPage/ModeratorTeaschersPage.tsx | Adds moderator teachers list page with pagination and status changes. |
| client/src/layouts/PrivateLayout.tsx | Adds moderator sidebar items selection logic. |
| client/src/features/teachers/query/useTeachersQuery.tsx | Adjusts teachers list query behavior. |
| client/src/features/teachers/query/useTeacherQuery.ts | Chooses teacher detail API based on role (moderator vs public). |
| client/src/features/teachers/query/useTeacherForModeratorQuery.tsx | Adds moderator teachers list query hook. |
| client/src/features/queryKeys.ts | Extends teachers list key typing to include moderator params. |
| client/src/features/moderator/mutation/useChangeStatus.ts | Adds mutation + optimistic cache update for teacher status changes. |
| client/src/components/teacherCard/teacherCard.tsx | Adds status-aware styling and moderation controls + “Details” navigation for moderators. |
| client/src/components/statusChanger/StatusChange.tsx | Adds status change button group component. |
| client/src/components/sidebar/sidebarMenuItems.ts | Adds moderator sidebar menu items. |
| client/src/components/cardsList/CardsList.tsx | Passes moderation props through to TeacherCard. |
| client/src/api/teacher/teacher.type.ts | Adds TeacherStatus and moderator sort/query types. |
| client/src/api/teacher/teacher.api.ts | Adds moderator teacher list and moderator teacher detail APIs. |
| client/src/api/moderator/moderator.type.ts | Adds moderator user type. |
| client/src/api/moderator/moderator.api.ts | Adds moderator “change teacher status” API. |
| client/src/api/auth/types.ts | Extends UserType to include moderator. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashaaaa21
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend part:
Frontend part: