Add funder query param for opportunities#2428
Conversation
a101749 to
7431fd3
Compare
There was a problem hiding this comment.
Pull request overview
Adds optional filtering of the existing GET /opportunities endpoint by funder shortCode, implemented end-to-end from request parsing through SQL query execution, with integration tests and changelog documentation.
Changes:
- Add
funderquery parameter toGET /opportunitiesOpenAPI spec and handler parsing. - Thread optional
funderShortCodeinto the opportunities bundle loader and SQL query to filter results. - Add integration tests for valid filtering and invalid filter validation; document in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/openapi/paths/opportunities.json | Documents new optional funder query parameter for listing opportunities. |
| src/handlers/opportunitiesHandlers.ts | Extracts funder from query string and passes it into the bundle loader. |
| src/database/queries/opportunities/selectWithPagination.sql | Adds optional funder short code filtering to the opportunities query. |
| src/database/operations/opportunities/loadOpportunityBundle.ts | Extends bundle loader to accept optional funderShortCode parameter. |
| src/tests/opportunities.int.test.ts | Adds integration tests for funder filtering and invalid filter handling. |
| package-lock.json | Lockfile metadata updates (adds peer: true flags). |
| CHANGELOG.md | Notes the new optional funder query parameter on GET /opportunities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2428 +/- ##
=======================================
Coverage 93.56% 93.56%
=======================================
Files 303 303
Lines 3838 3840 +2
Branches 515 517 +2
=======================================
+ Hits 3591 3593 +2
Misses 246 246
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3d06652 to
e7a7045
Compare
e7a7045 to
a10ad3c
Compare
This commit adds in a funder query parameter to the opportunities handler, and corresponding database query, that allows for filtering on funder shortCode. Issue #2372 Add endpoint to query related opportunities for a funder
a10ad3c to
847d397
Compare
|
@slifty addressed the coercion issue, good catch from ze bot |
This commit adds in a funder query parameter to the opportunities handler, and corresponding database query, that allows for filtering on funder shortCode.
Closes #2372