expressa 2.0.10 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/util.js +2 -2
package/package.json
CHANGED
package/util.js
CHANGED
|
@@ -203,11 +203,11 @@ exports.mongoToPostgres = mongoToPostgres
|
|
|
203
203
|
// paging requires orderby to include a field that is known to be unique and constant
|
|
204
204
|
// to ensure consistent results from database with offset and limit. Chosen field should
|
|
205
205
|
// also represent a preferred ordering when doing final sort
|
|
206
|
-
exports.orderByForPagedRequests = function(orderby, finalSortField = 'meta.created') {
|
|
206
|
+
exports.orderByForPagedRequests = function(orderby, finalSortField = 'meta.created', finalSortDirection = 1) {
|
|
207
207
|
orderby = exports.normalizeOrderBy(orderby || {})
|
|
208
208
|
const allFields = orderby.map(([field]) => field)
|
|
209
209
|
if (!allFields.includes(finalSortField)) {
|
|
210
|
-
orderby.push([finalSortField,
|
|
210
|
+
orderby.push([finalSortField, finalSortDirection])
|
|
211
211
|
}
|
|
212
212
|
return orderby
|
|
213
213
|
}
|