Skip to content

Commit

Permalink
Cyberleague: [premieroctet#153] make isActionAllowed manage previous_…
Browse files Browse the repository at this point in the history
…question
  • Loading branch information
Bastien-Wappizy committed Sep 24, 2024
1 parent efbf8b4 commit 5abdafd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/web/server/plugins/cyberleague/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ const isActionAllowed = async ({action, dataId, user, ...rest}) => {
throw new ForbiddenError(`Il faut répondre à la question avant de pouvoir terminer le questionnaire`)
}
}

if (action == 'previous_question') {
//if first answer
if (answerIndex == 0) {
throw new NotFoundError(`Il n'y a pas de question précédente`)
}
}
}
}

Expand Down

0 comments on commit 5abdafd

Please sign in to comment.