feat(massif): add GET /api/v1/massifs/count endpoint#1704
Merged
Conversation
- Add count controller returning total non-deleted massifs - Add route and public access policy - Add integration test - Update OpenAPI spec
…llers
- ControllerService.treat only uses notFoundMessage when found is falsy
- Count controllers always pass { count } which is always truthy
- Affects: massif, entrance, public-count, document, caver, partner,
organization, bibliographic-metadata
Contributor
|
The implementation is clean and consistent with the existing count endpoint pattern ( |
Paul-AUB
approved these changes
Jun 26, 2026
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.
🤔 What
GET /api/v1/massifs/countendpoint returning the total number of non-deleted massifsGET /api/v1/massifs/countendpoint #1700🤷♂️ Why
The homepage currently displays a hardcoded ">4700 massifs" value. This endpoint enables the frontend to fetch a live count, consistent with how other entity counts (entrances, documents, organizations) are already served.
🔍 How
Follows the exact same pattern as existing count endpoints (
/entrances/count,/documents/count,/organizations/count):TMassif.count({ isDeleted: false })and returns{ count }viaControllerService.treatCountschema🧪 Testing
Or hit the endpoint directly:
📸 Previews
N/A — backend-only change.