@@ -83,7 +83,6 @@ export default (serverEndpoint, httpClient, config) => {
83
83
params . sort . field = primaryKey ;
84
84
}
85
85
86
- const orderBy = primaryKey !== DEFAULT_PRIMARY_KEY && params . sort . field === DEFAULT_PRIMARY_KEY ? primaryKey : params . sort . field ;
87
86
switch ( type ) {
88
87
case 'GET_LIST' :
89
88
// select multiple
@@ -94,7 +93,7 @@ export default (serverEndpoint, httpClient, config) => {
94
93
finalSelectQuery . args . limit = params . pagination . perPage ;
95
94
finalSelectQuery . args . offset = ( params . pagination . page * params . pagination . perPage ) - params . pagination . perPage ;
96
95
finalSelectQuery . args . where = params . filter ;
97
- finalSelectQuery . args . order_by = { column : orderBy , type : typeof params . sort . order === 'undefined' ? 'asc' : params . sort . order . toLowerCase ( ) } ;
96
+ finalSelectQuery . args . order_by = { column : params . sort . field , type : typeof params . sort . order === 'undefined' ? 'asc' : params . sort . order . toLowerCase ( ) } ;
98
97
finalCountQuery . args . table = { 'name' : tableName , 'schema' : schema } ; ;
99
98
finalCountQuery . args . where = { } ;
100
99
finalCountQuery . args . where [ primaryKey ] = { '$ne' : null } ;
@@ -186,7 +185,7 @@ export default (serverEndpoint, httpClient, config) => {
186
185
finalManyRefQuery . args . offset = ( params . pagination . page * params . pagination . perPage ) - params . pagination . perPage ;
187
186
finalManyRefQuery . args . where = { [ params . target ] : params . id } ;
188
187
finalManyRefQuery . args . where = addFilters ( finalManyRefQuery . args . where , params . filter ) ;
189
- finalManyRefQuery . args . order_by = { column : orderBy , type : typeof params . sort . order === 'undefined' ? 'asc' : params . sort . order . toLowerCase ( ) } ;
188
+ finalManyRefQuery . args . order_by = { column : params . sort . field , type : typeof params . sort . order === 'undefined' ? 'asc' : params . sort . order . toLowerCase ( ) } ;
190
189
finalManyRefCountQuery . args . table = { 'name' : tableName , 'schema' : schema } ; ;
191
190
finalManyRefCountQuery . args . where = { } ;
192
191
finalManyRefCountQuery . args . where [ primaryKey ] = { '$ne' : null } ;
0 commit comments