Skip to content

Sort Not Respecting Param Order #26

@melch

Description

@melch

The sorts are not respecting the order passed by the client when chaining multiple sorts. It appears that sort order is determined by the order in which sort_on is declared in the filterable class.

For example, passing the following sort params both result in the same query:
sort=title,submittal_package
sort=submittal_package,title

ORDER BY LOWER(submittal_logs.title) ASC NULLS FIRST,
  natural_sort(packages_for_sort.number) COLLATE en_US ASC,
  natural_sort(packages_for_sort.title) COLLATE en_US ASC NULLS FIRST

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions