sort tasks by id

parent 6de16809
......@@ -15,7 +15,7 @@ module.exports = function (Task) {
return dbUtils.dbFindOne(Task, {_id: taskId}, [{ path: 'contest' }]);
},
getTasksByContest : function (contestId) {
return dbUtils.dbFind(Task, {contest: contestId}, {population:[{ path: 'contest' }]});
return dbUtils.dbFind(Task, {contest: contestId}, {population:[{ path: 'contest' }], sort: {'_id': 1}});
},
removeTaskById : function (taskId) {
return dbUtils.dbRemoveItem(Task, {_id: taskId});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment