#7793 - sortByWeight #763

Open
jsegarra wants to merge 10 commits from 7793_sortByWeight into dev
1 changed files with 4 additions and 4 deletions
Showing only changes of commit 2d55013a90 - Show all commits

View File

@ -191,10 +191,10 @@ async function fetchFilter(val) {
const fetchOptions = { where, include, limit };
if (fields) fetchOptions.fields = fields;
if (sortBy) {
let sort = sortBy;
if (typeof sort === 'string') sort = [getOrderCaseString(key, val), sortBy];
else sort = [getOrderCaseString(key, val), ...sortBy];
fetchOptions.order = sort;
fetchOptions.order = [
getOrderCaseString(key, val),
typeof sortBy === 'string' ? sortBy : [...sortBy],
];
}
return dataRef.value.fetch(fetchOptions);