mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
changed sort -> sortOrder
This commit is contained in:
@@ -15,7 +15,7 @@ const genUserByIDs = (context, ids) => UsersService
|
||||
* @param {Object} context graph context
|
||||
* @param {Object} query query terms to apply to the users query
|
||||
*/
|
||||
const getUsersByQuery = ({user}, {ids, limit, cursor, statuses = null, sort}) => {
|
||||
const getUsersByQuery = ({user}, {ids, limit, cursor, statuses = null, sortOrder}) => {
|
||||
|
||||
let users = UserModel.find();
|
||||
|
||||
@@ -36,7 +36,7 @@ const getUsersByQuery = ({user}, {ids, limit, cursor, statuses = null, sort}) =>
|
||||
}
|
||||
|
||||
if (cursor) {
|
||||
if (sort === 'DESC') {
|
||||
if (sortOrder === 'DESC') {
|
||||
users = users.where({
|
||||
created_at: {
|
||||
$lt: cursor
|
||||
@@ -52,7 +52,7 @@ const getUsersByQuery = ({user}, {ids, limit, cursor, statuses = null, sort}) =>
|
||||
}
|
||||
|
||||
return users
|
||||
.sort({created_at: sort === 'DESC' ? -1 : 1})
|
||||
.sort({created_at: sortOrder === 'DESC' ? -1 : 1})
|
||||
.limit(limit);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user