Skip to content

Commit

Permalink
EDF: [premieroctet#128] typo un order creation in generation order ac…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
Bastien-Wappizy committed Dec 19, 2024
1 parent 2701044 commit e031dc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/web/server/plugins/entreprisedufutur/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const generateOrder = async ({value,nb_tickets}, user) => {
throw new NotFoundError(`no eventTicket id`)
}

const model = getModel(value)
const model = await getModel(value)
if (model != 'eventTicket') {
throw new TypeError(`value type is ${model} instead of eventTicket`)
}
Expand All @@ -159,7 +159,7 @@ const generateOrder = async ({value,nb_tickets}, user) => {
throw new TypeError(`nb_tickets is not a number`)
}

const order = await Order.create({eventTicket: value, status: ORDER_STATUS_IN_PROGRESS})
const order = await Order.create({event_ticket: value, status: ORDER_STATUS_IN_PROGRESS})

const eventTicket = await EventTicket.findById(value, ['remaining_tickets'])
const remaining_tickets = eventTicket.remaining_tickets
Expand Down

0 comments on commit e031dc5

Please sign in to comment.