Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “subjects” domain end-to-end (DB schema → API endpoint → client query) so the Teachers filters can be populated from server-provided subjects rather than a client constant.
Changes:
- Server: introduce Subjects schema/query/controller/router and wire them into DI + Express routing.
- Client: add subjects API + React Query hook and pass fetched subjects into the Teachers filters (with a loading skeleton).
- UI/util: add a Radix-based Select component and a
formatDatehelper; remove unused utilities/components.
Reviewed changes
Copilot reviewed 24 out of 26 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/utils/mappers/subject.mapper.ts | Adds mapper from DB subject doc to API view model. |
| server/src/types/subjects/subjects.type.ts | Defines the subjects view type returned by the API. |
| server/src/routes/subjectRoute.ts | Adds /subjects route handler wiring to controller. |
| server/src/repositories/queryRepositories/subjects.query.ts | Implements query to fetch all subjects from Mongo. |
| server/src/db/schemes/types/subjects.types.ts | Adds DB type for subjects schema. |
| server/src/db/schemes/subjects.schema.ts | Introduces Mongoose schema + model for subjects. |
| server/src/controllers/subjects.controller.ts | Adds controller endpoint to return all subjects. |
| server/src/composition/compositionRoot.ts | Registers Subjects controller/query in Inversify container. |
| server/src/composition/composition.types.ts | Adds Inversify symbols for Subjects bindings. |
| server/src/app.ts | Registers subjects router in the Express app. |
| client/src/util/mapSubjectToOptions.util.ts | Maps API subjects to {label,value} options for UI. |
| client/src/util/date.util.ts | Adds formatDate helper and fixes import usage. |
| client/src/util/createTestIdFilePath.js | Removes unused test-id path helper. |
| client/src/pages/teachersPage/TeachersPage.tsx | Fetches subjects and injects options into Filters; adds skeleton + scroll-to-top on pagination. |
| client/src/pages/chat/chatDialogPage/ChatDialogPage.tsx | Fixes formatDate import path. |
| client/src/features/subjects/query/useSubjectsQuery.tsx | Adds React Query hook for loading subjects. |
| client/src/features/queryKeys.ts | Adds subjectsKey; removes unused teachers detail key. |
| client/src/components/ui/select/Select.tsx | Adds Radix Select wrapper component. |
| client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx | Updates Select import path. |
| client/src/components/teacherProfileSection/ProfileExperienceEducation.tsx | Updates Select import path. |
| client/src/components/teacherProfileSection/LessonForm.tsx | Updates Select import path. |
| client/src/components/skeletons/FiltersSkeleton.tsx | Adds loading skeleton for Filters sidebar. |
| client/src/components/filters/Filters.tsx | Accepts subject options via props instead of constants. |
| client/src/api/subjects/subjects.type.ts | Adds client-side type for subject items. |
| client/src/api/subjects/subjects.api.ts | Adds API call to fetch all subjects. |
| client/src/App.tsx | Removes unused App component (Router is used instead). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashaaaa21
approved these changes
Feb 26, 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.
Added subjects schema and subjects for filters