-
Notifications
You must be signed in to change notification settings - Fork 55
2027 new design payment drawer #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2027 new design payment drawer #720
Conversation
Refactor code structure for improved readability and maintainability
- Add sortBy and sortOrder query parameters to listDonationsPublic endpoint - Support sorting by 'createdAt' or 'amount' fields with 'asc'/'desc' order - Default sorting: createdAt desc - Add Swagger API documentation for new parameters Relates to: #2027
|
✅ Tests will run for this PR. Once they succeed it can be merged. |
There was a problem hiding this 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 upgrades the Yarn package manager from version 3.3.0 to 4.12.0 and adds sorting support to the public donations endpoint.
Changes:
- Updated Yarn package manager to version 4.12.0
- Added sorting parameters (sortBy and sortOrder) to the donations API endpoint
- Updated Yarn configuration files to align with the new version
Reviewed changes
Copilot reviewed 6 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated packageManager field to yarn@4.12.0 |
| apps/api/src/donations/donations.service.ts | Added sortBy and sortOrder parameters with validation logic to enable sorting donations |
| apps/api/src/donations/donations.controller.ts | Added API query parameters for sortBy and sortOrder |
| .yarnrc.yml | Updated Yarn configuration for version 4.12.0 |
| .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | Removed plugin file (replaced by version 4.12.0 plugin) |
| .yarn/plugins/@yarnpkg/plugin-typescript.cjs | Removed plugin file (replaced by version 4.12.0 plugin) |
| .env | Removed trailing whitespace from CORPORATE_DONORS_EMAIL line |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Build orderBy based on sortBy parameter | ||
| const validSortFields = ['createdAt', 'amount'] | ||
| const validSortOrders = ['asc', 'desc'] | ||
| const orderField = validSortFields.includes(sortBy || '') ? sortBy : 'createdAt' |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sortBy is undefined or an empty string, the ternary will evaluate the empty string case and incorrectly assign it to orderField. This should check if sortBy is a valid field or fallback to 'createdAt'.
| const validSortFields = ['createdAt', 'amount'] | ||
| const validSortOrders = ['asc', 'desc'] | ||
| const orderField = validSortFields.includes(sortBy || '') ? sortBy : 'createdAt' | ||
| const orderDirection = validSortOrders.includes(sortOrder || '') ? sortOrder : 'desc' |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If sortOrder is undefined or an empty string, the ternary will evaluate the empty string case and incorrectly assign it to orderDirection. This should check if sortOrder is a valid direction or fallback to 'desc'.
sashko9807
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please revert any yarn changes? If update is needed(not saying it is), lets do so in a separate build
.yarn/releases/yarn-4.12.0.cjs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not update/change anything yarn related in this PR.
This reverts commit cec3f8b.
feat(donations): add sorting support for public donations endpoint
Closes #{issue number}
Motivation and context
In order to be able to sort on the backend side full data and not only fetched data to the frontend side
In order to be able to sort on the backend side full data and not only fetched data to the frontend side
By adding two new parameters, sortBy and sortDir to the API
Testing
Steps to test
New endpoints
Environment
New environment variables:
NEW_ENV_VAR: env var detailsNew or updated dependencies:
dependency/namev1.0.0v2.0.0