diff --git a/backend/web/server/plugins/entreprisedufutur/event.js b/backend/web/server/plugins/entreprisedufutur/event.js index 9805f7788..b694fb42a 100644 --- a/backend/web/server/plugins/entreprisedufutur/event.js +++ b/backend/web/server/plugins/entreprisedufutur/event.js @@ -19,10 +19,10 @@ const getRegistered = async function (userId, params, data,fields) { return users.map(u=> new User(u)) } -const getRegisteredNumber = async function (userId, params, data) { +const getRegisteredNumber = async function (userId, params, data,fields) { const eventTickets = await EventTicket.find({event: data._id}) const eventTicketIds = eventTickets.map(ticket => ticket._id) - const userTickets = await UserTicket.find({event_ticket: {$in: eventTicketIds}}) + const userTickets = await UserTicket.find({event_ticket: {$in: eventTicketIds}, status: {$in: [USERTICKET_STATUS_PAYED, USERTICKET_STATUS_PENDING_PAYMENT,USERTICKET_STATUS_REGISTERED]}}) return userTickets.map(ticket=> ticket.user).length }