diff --git a/content/edweb-api.xql b/content/edweb-api.xql index 8b836d1..344016c 100644 --- a/content/edweb-api.xql +++ b/content/edweb-api.xql @@ -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 diff --git a/views/api/object-list.xql b/views/api/object-list.xql index daa0923..315371b 100644 --- a/views/api/object-list.xql +++ b/views/api/object-list.xql @@ -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)