Skip to content

Commit

Permalink
update deliverables grading #106
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Fejes committed Sep 24, 2018
1 parent 310ab43 commit 205f84a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions endpoints/deliverables/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ module.exports = async (req, res) => {
}

const { data } = req.body;

if (data.attributes.grade === null || data.attributes.grade < 1 || data.attributes.grade > 5) {
throw new Error('Please provide proper grade (1-5)');
}

const db = getDB();
const deliverable = await db.Deliverables.findById(reqId);
checkIfExist(deliverable);
Expand Down

0 comments on commit 205f84a

Please sign in to comment.