fix: default sort with multi filter target keys (#5383)

This commit is contained in:
ChengLei Shao 2024-10-10 14:45:06 +08:00 committed by GitHub
parent 2672789a64
commit ad767a3c1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,6 +140,10 @@ export class OptionsParser {
let defaultSortField = this.model.primaryKeyAttribute;
if (Array.isArray(this.collection.filterTargetKey) && this.collection.filterTargetKey.length == 1) {
defaultSortField = this.collection.filterTargetKey[0];
}
if (!defaultSortField && this.collection.filterTargetKey && !Array.isArray(this.collection.filterTargetKey)) {
defaultSortField = this.collection.filterTargetKey;
}