From ed96d186394897616ad873f2d4c74765c18dd30e Mon Sep 17 00:00:00 2001 From: Siddharth Dungarwal Date: Tue, 20 Feb 2018 15:45:26 +0530 Subject: [PATCH] Added orderby in contest and it is present in problems. --- services/contest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/contest.js b/services/contest.js index 37e87b55..eead149e 100644 --- a/services/contest.js +++ b/services/contest.js @@ -85,6 +85,7 @@ const getAllContests = function (params, user_id) { }; return Promise.all([Contest.findAll({ where, + order: '"createdAt" DESC', limit: params.page.size, offset: (params.page.number - 1) * params.page.size }), @@ -155,4 +156,4 @@ exports.addContest = addContest; exports.deleteContest = deleteContest; exports.updateContest = updateContest; exports.getAllPublicContests = getAllPublicContests; -exports.getAllowedContests = getAllowedContests; \ No newline at end of file +exports.getAllowedContests = getAllowedContests;