Skip to content
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

Fixed sorting on non-asset relations in API (FD#23117) #10114

Merged
merged 2 commits into from
Sep 22, 2021

Conversation

snipe
Copy link
Owner

@snipe snipe commented Sep 22, 2021

This fixes an issue where some items (non-assets) were not sorting properly on relations via their query scopes.

It also addresses a few places where we were not eager loading relations, causing an n+1 query issue, and adds Supplier as a sortable column via query scope for Accessories.

Signed-off-by: snipe <snipe@snipe.net>
Signed-off-by: snipe <snipe@snipe.net>
Copy link
Collaborator

@uberbrady uberbrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I love the consistency across the different controllers, I love the new formatting you're using for $allowed_columns, and it also looks like it should work even better than before. Great work!

'created_at',
'min_amt',
'company_id'
];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love these comments and this column-name per-line thing, so much easier to work with!

@snipe snipe merged commit 0be4b21 into develop Sep 22, 2021
@snipe
Copy link
Owner Author

snipe commented Sep 22, 2021

Thanks @uberbrady. (I honestly don't know how sorting worked before with the relations in the allowed_columns array.....)

@snipe snipe deleted the fixes/sorting_in_non_assets branch September 22, 2021 03:10
@snipe snipe changed the title Fixes sorting on non-asset relations in API Fixes sorting on non-asset relations in API - fixed FD#23117 Sep 22, 2021
@snipe snipe changed the title Fixes sorting on non-asset relations in API - fixed FD#23117 Fixed sorting on non-asset relations in API - fixed FD#23117 Sep 22, 2021
@snipe snipe changed the title Fixed sorting on non-asset relations in API - fixed FD#23117 Fixed sorting on non-asset relations in API (FD#23117) Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants