Skip to content

Commit

Permalink
Aceita grade e status simultaneamente nas defenses
Browse files Browse the repository at this point in the history
  • Loading branch information
lubien committed Jul 7, 2019
1 parent c4a4366 commit 57254db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/controllers/defenses/Update.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ module.exports = async function updateDefense(ctx) {
return
}

if (payload.status === 'done' && defense.get('grade') === undefined) {
const grade = payload.grade || defense.get('grade')
if (payload.status === 'done' && !grade) {
ctx.status = 422
ctx.body = { code: errors.MISSING_GRADE }
return
Expand Down

0 comments on commit 57254db

Please sign in to comment.