Skip to content

feature/get-all-organizations#52

Merged
mdawoud27 merged 4 commits into
mainfrom
feature/51/get_all_organizations
Apr 3, 2025
Merged

feature/get-all-organizations#52
mdawoud27 merged 4 commits into
mainfrom
feature/51/get_all_organizations

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 #51

@mdawoud27 mdawoud27 added documentation Improvements or additions to documentation enhancement New feature or request feature For new feature labels Apr 3, 2025
@mdawoud27 mdawoud27 requested a review from Copilot April 3, 2025 15:41
@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.

Pull Request Overview

This PR introduces a new feature endpoint to retrieve all organizations with support for pagination, filtering, and sorting, along with documentation updates and an admin permission middleware.

  • Added the getAllOrganizations endpoint in the routes with detailed Swagger documentation.
  • Created a new middleware to verify admin permissions.
  • Implemented a new controller function to query organizations from the database with pagination and related statistics.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/routes/organization.routes.js Added new GET route with Swagger docs for retrieving organizations
src/middlewares/verifyAdminPermission.middleware.js Introduced middleware to restrict endpoint access to admins
src/controllers/organization.controller.js Implemented the getAllOrganizations function with filtering, pagination, and related data formatting
Comments suppressed due to low confidence (1)

src/controllers/organization.controller.js:211

  • The conversion for isVerified relies on strict string comparison, which may not handle boolean input consistently. Consider using a robust conversion approach or utility to ensure the expected boolean value is obtained.
      ...(filters.isVerified !== undefined && { isVerified: filters.isVerified === 'true', }),

@mdawoud27 mdawoud27 merged commit 927b660 into main Apr 3, 2025
11 checks passed
@mdawoud27 mdawoud27 deleted the feature/51/get_all_organizations branch April 3, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request feature For new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Get all organizations

2 participants