Skip to content

Commit

Permalink
change lease ordering fields (#488)
Browse files Browse the repository at this point in the history
change is matching change in API
  • Loading branch information
henrinie-nc authored Jun 11, 2024
1 parent 9dc2a57 commit 547f4f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/leases/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2783,13 +2783,13 @@ export const mapLeaseSearchFilters = (query: Record<string, any>): Record<string

if (searchQuery.sort_key) {
if (searchQuery.sort_key === 'identifier') {
searchQuery.ordering = ['identifier__type__identifier', 'identifier__municipality__identifier', 'identifier__district__identifier', 'identifier__sequence'];
searchQuery.ordering = ['type__identifier', 'municipality__identifier', 'district__identifier', 'identifier__sequence'];
} else {
searchQuery.ordering = [searchQuery.sort_key];
}

if (searchQuery.sort_order === TableSortOrder.DESCENDING) {
searchQuery.ordering = searchQuery.ordering.map(key => `-${key}`);
searchQuery.ordering = searchQuery.ordering.map((key: string) => `-${key}`);
}

delete searchQuery.sort_key;
Expand Down

0 comments on commit 547f4f3

Please sign in to comment.