feature/update-organization#56
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new feature to update organization details by adding a new validation schema, route, and controller logic for handling updates.
- Added updateOrganizationValidation in the validations file for updating organization fields.
- Updated the routes file to include a new PUT endpoint with full Swagger documentation.
- Implemented the updateOrganization controller with permission checks and email verification logic for contact email updates.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/validations/organization.validation.js | Added a new Joi schema to validate update requests with various fields. |
| src/routes/organization.routes.js | Introduced a new PUT route and updated Swagger documentation for organization updates. |
| src/controllers/organization.controller.js | Implemented updateOrganization to validate, authorize, and update organization data with email verification. |
Comments suppressed due to low confidence (2)
src/validations/organization.validation.js:101
- The valid values for sizeRange do not include the example value '50-200' shown in the Swagger documentation. Consider aligning the valid options with the documented examples.
sizeRange: Joi.string().valid('1-10', '11-50', '51-200', '201-500', '501-1000', '1000+').optional()
src/validations/organization.validation.js:142
- The schema does not include validated fields for 'status' and 'isVerified', which are documented in the Swagger spec. If these fields are intended to be updatable by admins, consider adding them to the validation schema.
orgOwnerId: Joi.string().uuid().messages({
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.
PR Checklist (required)
Please check if your PR fulfills the following requirements:
The commit message follows our guidelines.
Tests for the changes have been added (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
Related Issue
Closes #55