Repository navigation
Fe/be improve appointments - #142
Merged
Merged
Conversation
dashaaaa21
requested review from
Alaa2019-ml,
Majoodeh and
Copilot
and removed request for
Alaa2019-ml,
Majoodeh and
Copilot
March 4, 2026 06:50
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves request validation and authorization handling across the backend, and aligns the appointment “description” validation with the updated frontend rule (500 characters).
Changes:
- Add backend appointment
descriptionvalidation using a shared max-length constant (500 chars). - Introduce reusable request validation helpers (
validatePaginationParams,validateAuthorization) and apply them across multiple controllers. - Update client-side description validation/UI from word-count to character-count (500 chars) and improve textarea labeling.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/validation/appointment/appointmentValidationMiddleware.ts | Adds optional description max-length validation using a shared constant. |
| server/src/utils/validation/requestValidation.util.ts | Introduces shared authorization + pagination validation helpers. |
| server/src/controllers/videoCall.controller.ts | Refactors auth checks to use validateAuthorization and changes role error responses. |
| server/src/controllers/upload.controller.ts | Refactors auth checks to use validateAuthorization for avatar upload/delete. |
| server/src/controllers/teacher.controller.ts | Refactors auth checks to use validateAuthorization. |
| server/src/controllers/student.controller.ts | Refactors auth checks to use validateAuthorization. |
| server/src/controllers/review.controller.ts | Refactors auth + pagination parsing using new helpers. |
| server/src/controllers/appointment.controller.ts | Refactors pagination parsing and auth checks using new helpers. |
| server/src/constants/validation.constants.ts | Adds server-side constant for max description length (500). |
| client/src/utils/appointmentDescription.validation.ts | Switches from word-count to character-count validation (500). |
| client/src/components/teacherSection/teacherSchedule/TeacherSchedule.tsx | Updates UI to show character count and improves textarea accessibility attributes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Majoodeh
approved these changes
Mar 4, 2026
This branch was previously deployed
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.
On teacherDetail changed validation - now description 500 characters
Improve validation