changed cursor to Cursor scalar type, changed SORT_ORDER

This commit is contained in:
Wyatt Johnson
2017-08-17 16:43:55 -06:00
parent a9abd55895
commit 686eb614f7
15 changed files with 77 additions and 37 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ const getUsersByQuery = ({user}, {ids, limit, cursor, statuses = null, sort}) =>
}
if (cursor) {
if (sort === 'REVERSE_CHRONOLOGICAL') {
if (sort === '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 === 'REVERSE_CHRONOLOGICAL' ? -1 : 1})
.sort({created_at: sort === 'DESC' ? -1 : 1})
.limit(limit);
};