Add some methods

parent 8b3c89bf
......@@ -35,8 +35,11 @@ module.exports = function (Contest) {
updateContestMeta : function (contestId, meta) {
return dbUtils.dbFindOneAndUpdate(Contest, {_id: contestId}, {meta : meta});
},
copyСontest: function (contestId) {
copyContest: function (contestId) {
return dbUtils.dbDuplicateAndUpdate(Contest, {_id : contestId}, {})
},
setContestCourse : function (contestId, courseId) {
return dbUtils.dbFindOneAndUpdate(Contest, {_id: contestId}, {course : courseId});
}
};
};
......@@ -37,6 +37,9 @@ module.exports = function (Task) {
},
copyTask: function (taskId) {
return dbUtils.dbDuplicateAndUpdate(Task, {_id : taskId}, {})
},
setTaskContest : function (taskId, contestId) {
return dbUtils.dbFindOneAndUpdate(Task, {_id: taskId}, {contest : contestId});
}
};
};
{
"name": "mirera-db",
"version": "1.6.0",
"version": "1.6.1",
"description": "DB utils for mirera program testing server",
"main": "index.js",
"scripts": {
......
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