Skip to content

Commit 6feda30

Browse files
committed
Merge branch 'master' of https://github.com/TheCodeCamp/CodeCamp
2 parents 39d4d38 + 687843d commit 6feda30

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

server/routes/contest.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ router.post('/',(req,res)=>{
2727

2828
router.get('/:id',(req,res)=>{
2929
const id = req.params.id;
30-
Contest.findOne({'id':id},(err,contest)=>{
30+
var Projection={
31+
_id:false,
32+
'questions.name':true,
33+
'questions.code':true
34+
35+
}
36+
Contest.findOne({'id':id},Projection,(err,contest)=>{
3137
if(err){
3238
return res.status(400).json({
3339
'success':false,
@@ -108,7 +114,7 @@ router.get('/:id',(req,res)=>{
108114
// problem routes
109115

110116

111-
router.post('/:id/question' , (req,res)=>{
117+
router.post('/:id' , (req,res)=>{
112118
const id = req.params.id;
113119
var body = _.pick(req.body,['code','name','successfulSubmission','level','description','input_format','output_format','constraints','input_example','output_example','explanation_example','date_added','timelimit','sourcelimit','author']);
114120
var problem = new Problem(body);

0 commit comments

Comments
 (0)