|
@@ -150,7 +150,6 @@ module.exports = (crowi) => {
|
|
|
query('sortOrder').isIn(['asc', 'desc']),
|
|
query('sortOrder').isIn(['asc', 'desc']),
|
|
|
// validate sort : what column you will sort
|
|
// validate sort : what column you will sort
|
|
|
query('sort').isIn([
|
|
query('sort').isIn([
|
|
|
- 'id',
|
|
|
|
|
'status',
|
|
'status',
|
|
|
'username',
|
|
'username',
|
|
|
'name',
|
|
'name',
|
|
@@ -341,6 +340,8 @@ module.exports = (crowi) => {
|
|
|
const { sort, sortOrder } = req.query;
|
|
const { sort, sortOrder } = req.query;
|
|
|
const sortOutput = {
|
|
const sortOutput = {
|
|
|
[sort]: sortOrder === 'desc' ? -1 : 1,
|
|
[sort]: sortOrder === 'desc' ? -1 : 1,
|
|
|
|
|
+ // tiebreaker: ensure stable pagination when the primary sort key has duplicate values
|
|
|
|
|
+ _id: 1,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// For more information about the external specification of the User API, see here (https://dev.growi.org/5fd7466a31d89500488248e3)
|
|
// For more information about the external specification of the User API, see here (https://dev.growi.org/5fd7466a31d89500488248e3)
|