Skip to content

Commit

Permalink
Add order by filter for object list
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinFechner committed Jun 7, 2022
1 parent 95aaa53 commit a33cfc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion content/edweb-api.xql
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,10 @@ declare function edwebapi:order-items(
) as map(*)*
{
if (not($order eq 'label'))
then $list
then
for $item in $list
order by $item?filter?($order)
return $item
else
let $long-list :=
for $item in $list
Expand Down
2 changes: 1 addition & 1 deletion views/api/object-list.xql
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ return
)
else $result
let $array := $result?list?*
let $array := edwebapi:order-items($array, $order)
let $array := if ($order||"" != "") then edwebapi:order-items($array, $order) else $array
let $array := edwebapi:filter-list($array, $result?filter, $filter-params)
return
if ($page)
Expand Down

0 comments on commit a33cfc3

Please sign in to comment.