Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin submission endpoints #259

Open
wants to merge 12 commits into
base: env/dev
Choose a base branch
from
31 changes: 31 additions & 0 deletions server/api/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,38 @@ router.get('/:teamID/:submissionID', async (req, res) => {
* tags:
* - submissions
*/
<<<<<<< Updated upstream
5H1V marked this conversation as resolved.
Show resolved Hide resolved
router.post('/:teamID/create', (req, res) => {
=======
5H1V marked this conversation as resolved.
Show resolved Hide resolved
router.create('/:teamID', aysnc (req, res)) {
if (!req.body.title) {
res.status(200).send(err);
return;
}
const submission = new Submission({
title: req.params.teamID,
description: req.body.description,
published: req.body.published ? req.body.published : true
});
const submission = new Submission({
title: req.body.submissionID,
description: req.body.description,
published: req.body.published ? req.body.published : true
});
5H1V marked this conversation as resolved.
Show resolved Hide resolved
submission
.save(submission)
.then(data => {
res.send(data);
})
.catch(err => {
res.status(500).send({
message: err
});
});
};

router.post('/', (req, res) => {
>>>>>>> Stashed changes
5H1V marked this conversation as resolved.
Show resolved Hide resolved
Submission.create({}, (err, submission) => {
if (err) res.status(500).send(err);
res.status(200).json({
Expand Down