From ae4636abdbc80fd41b1a1a1e69f3921137f4e898 Mon Sep 17 00:00:00 2001 From: David Arranz Date: Wed, 22 Mar 2023 10:20:41 +0100 Subject: [PATCH] =?UTF-8?q?Arreglo=20para=20que=20no=20a=C3=B1adida=20asis?= =?UTF-8?q?tentes=20de=20la=20reserva=20borrada=20en=20el=20caso=20de=20no?= =?UTF-8?q?=20estar=20publiecada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/events/events_inscriptions.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/events/events_inscriptions.controller.js b/modules/events/events_inscriptions.controller.js index 4ca1346..8574b83 100644 --- a/modules/events/events_inscriptions.controller.js +++ b/modules/events/events_inscriptions.controller.js @@ -485,7 +485,7 @@ const extraControllers = { if (!((await eventReservationService._deleteReservation(inscription.reservation.id)) > 0)) return handleResultResponse("No se pudo eliminar inscripción por ser tutor de grupo online y tener alumnos apuntados, pongase en contacto con nosotros", null, params, res, httpStatus.NOT_FOUND); - if (lodash.words(inscription.type).includes("onsite")) { + if (inscription.reservation.state === 'publish' && lodash.words(inscription.type).includes("onsite")) { const eventOfReservation = await eventService._getEvent(inscription.reservation.eventId); //Modificamos los asistentes de evento (AFORO) para añadir las plazas de la reserva eliminada const newAforo = eventOfReservation.assistants + inscription.reservation.assistants;