feat: refs #7793 perf sortByWeight
This commit is contained in:
parent
3476b4807f
commit
2d55013a90
|
@ -191,10 +191,10 @@ async function fetchFilter(val) {
|
||||||
const fetchOptions = { where, include, limit };
|
const fetchOptions = { where, include, limit };
|
||||||
if (fields) fetchOptions.fields = fields;
|
if (fields) fetchOptions.fields = fields;
|
||||||
if (sortBy) {
|
if (sortBy) {
|
||||||
let sort = sortBy;
|
fetchOptions.order = [
|
||||||
if (typeof sort === 'string') sort = [getOrderCaseString(key, val), sortBy];
|
getOrderCaseString(key, val),
|
||||||
else sort = [getOrderCaseString(key, val), ...sortBy];
|
typeof sortBy === 'string' ? sortBy : [...sortBy],
|
||||||
fetchOptions.order = sort;
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataRef.value.fetch(fetchOptions);
|
return dataRef.value.fetch(fetchOptions);
|
||||||
|
|
Loading…
Reference in New Issue