changed sort -> sortOrder

This commit is contained in:
Wyatt Johnson
2017-08-25 09:59:37 -06:00
parent 48595a1bbf
commit 8a5db167ff
14 changed files with 75 additions and 79 deletions
+2 -2
View File
@@ -129,12 +129,12 @@ function getReactionConfig(reaction) {
endCursor(ctx, nodes, {cursor}) {
return nodes.length ? (cursor != null ? cursor : 0) + nodes.length : null;
},
sort(ctx, query, {cursor, sort}) {
sort(ctx, query, {cursor, sortOrder}) {
if (cursor) {
query = query.skip(cursor);
}
return query.sort({[`action_counts.${reaction}`]: sort === 'DESC' ? -1 : 1, created_at: sort === 'DESC' ? -1 : 1});
return query.sort({[`action_counts.${reaction}`]: sortOrder === 'DESC' ? -1 : 1, created_at: sortOrder === 'DESC' ? -1 : 1});
},
},
},