Skip to content

feature/update-organization#56

Merged
mdawoud27 merged 4 commits into
mainfrom
feature/55/update_organization
Apr 3, 2025
Merged

feature/update-organization#56
mdawoud27 merged 4 commits into
mainfrom
feature/55/update_organization

Conversation

@mdawoud27
Copy link
Copy Markdown
Contributor

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?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation changes
  • Other... Please describe:

Related Issue

Closes #55

@mdawoud27 mdawoud27 added enhancement New feature or request feature For new feature labels Apr 3, 2025
@mdawoud27 mdawoud27 requested a review from Copilot April 3, 2025 18:36
@mdawoud27 mdawoud27 self-assigned this Apr 3, 2025
@mdawoud27 mdawoud27 linked an issue Apr 3, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@mdawoud27 mdawoud27 requested a review from Copilot April 3, 2025 18:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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({

Comment thread src/controllers/organization.controller.js
@mdawoud27 mdawoud27 merged commit e3a4ab0 into main Apr 3, 2025
11 checks passed
@mdawoud27 mdawoud27 deleted the feature/55/update_organization branch April 3, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature For new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Update an organization

2 participants