-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
I should be able to sort by amount #6056
Comments
To implement sorting and filtering for the currency field type, follow these steps:
Example Code Snippet for Sorting: // Add this in the relevant sorting utility function
if (field.type === 'Currency') {
// Sorting logic for currency
return records.sort((a, b) => parseFloat(a[field.name]) - parseFloat(b[field.name]));
} Example Code Snippet for Filtering: // Add this in the relevant filtering utility function
if (field.type === 'Currency') {
// Filtering logic for currency
return records.filter(record => record[field.name] === filterValue);
} References/packages/twenty-front/src/modules/object-metadata/utils/getObjectRecordIdentifier.ts |
Fixes : #6056 - Refactored the logic to get order by query variables for field types - Added a case for Currency field type
We haven't implemented sorting on the currency field type. It would be very useful.
While we're at it we should also solve for filtering?.
It's a composite type so that's probably why, but I see we did it for name.
The text was updated successfully, but these errors were encountered: