Skip to content

Fe/be improve appointments - #142

Merged
dashaaaa21 merged 3 commits into
developfrom
FE/BE-improve-appointments
Mar 4, 2026
Merged

dashaaaa21 merged 3 commits into
developfrom
FE/BE-improve-appointments

Conversation

@dashaaaa21

Copy link
Copy Markdown
Contributor

On teacherDetail changed validation - now description 500 characters
Improve validation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 description validation 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.

Comment thread server/src/controllers/review.controller.ts
Comment thread server/src/controllers/upload.controller.ts
Comment thread server/src/controllers/videoCall.controller.ts
Comment thread server/src/controllers/upload.controller.ts
Comment thread server/src/utils/validation/requestValidation.util.ts
@HackYourFutures
HackYourFutures temporarily deployed to study-bridge-fe-be-impr-tpj4ss March 4, 2026 07:20 Inactive
@dashaaaa21
dashaaaa21 merged commit 7fb9390 into develop Mar 4, 2026
2 checks passed

This branch was previously deployed

1 inactive deployment
study-bridge-fe-be-impr-tpj4ss — e72ff33c Deployed Mar 4, 2026 by HackYourFutures
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants