[#5641] changed the relation picker default sort to use rowid instead of created
This commit is contained in:
@@ -126,9 +126,14 @@
|
||||
}
|
||||
normalizedFilter += "(" + fileFields.map((f) => `${f.name}:length>0`).join("||") + ")";
|
||||
|
||||
let sort = "";
|
||||
if (selectedCollection.type != "view") {
|
||||
sort = "-@rowid"; // all collections with exception to the view has this field
|
||||
}
|
||||
|
||||
const result = await ApiClient.collection(selectedCollection.id).getList(page, batchSize, {
|
||||
filter: normalizedFilter,
|
||||
sort: "-created",
|
||||
sort: sort,
|
||||
fields: "*:excerpt(100)",
|
||||
skipTotal: 1,
|
||||
requestKey: uniqueId + "loadImagePicker",
|
||||
|
||||
@@ -159,9 +159,14 @@
|
||||
|
||||
const fallbackSearchFields = CommonHelper.getAllCollectionIdentifiers(collection);
|
||||
|
||||
let sort = "";
|
||||
if (!isView) {
|
||||
sort = "-@rowid"; // all collections with exception to the view has this field
|
||||
}
|
||||
|
||||
const result = await ApiClient.collection(collectionId).getList(page, batchSize, {
|
||||
filter: CommonHelper.normalizeSearchFilter(filter, fallbackSearchFields),
|
||||
sort: !isView ? "-created" : "",
|
||||
sort: sort,
|
||||
fields: "*:excerpt(200)",
|
||||
skipTotal: 1,
|
||||
expand: getExpand(),
|
||||
|
||||
Reference in New Issue
Block a user