diff --git a/backend/web/server/plugins/entreprisedufutur/actions.js b/backend/web/server/plugins/entreprisedufutur/actions.js index c66344fe6..681237806 100644 --- a/backend/web/server/plugins/entreprisedufutur/actions.js +++ b/backend/web/server/plugins/entreprisedufutur/actions.js @@ -150,6 +150,11 @@ const generateOrder = async ({value,nb_tickets}, user) => { throw new NotFoundError(`no eventTicket id`) } + const model = getModel(value) + if (model != 'eventTicket') { + throw new TypeError(`value type is ${model} instead of eventTicket`) + } + if (!testNumber(nb_tickets)) { throw new TypeError(`nb_tickets is not a number`) }