a
This commit is contained in:
parent
de061f9a82
commit
c04419e938
@ -165,12 +165,14 @@ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>><Inscripcion borrada');
|
||||
const EventOrReservationChangeId = ((inscription.reservationId) ? inscription.reservationId : ((inscription.overflowEventId) ? inscription.overflowEventId : inscription.eventId));
|
||||
let NewConfirmed = 0;
|
||||
let marketingListId = null;
|
||||
console.log('Tengo reservation>>>>>>>>>>>>>>>>>>', inscription.reservationId);
|
||||
|
||||
if (inscription.reservationId){
|
||||
console.log('Tengo reservation>>>>>>>>>>>>>>>>>>', inscription.reservationId);
|
||||
NewConfirmed = await eventInscriptionService._getCountInscriptionsWithReservation(EventOrReservationChangeId)
|
||||
marketingListId = (await eventReservationService._getReservaById(EventOrReservationChangeId)).marketing_list;
|
||||
}
|
||||
else if (inscription.overflowEventId) {
|
||||
console.log('Tengo overflow>>>>>>>>>>>>>>>>>>', inscription.overflowEventId);
|
||||
NewConfirmed = await eventInscriptionService._getCountInscriptionsWithOverflowEventId(EventOrReservationChangeId);
|
||||
marketingListId = (await eventService._getEvent(EventOrReservationChangeId)).marketing_list;
|
||||
}
|
||||
@ -182,11 +184,13 @@ console.log('Tengo reservation>>>>>>>>>>>>>>>>>>', inscription.reservationId);
|
||||
//Actualizamos aforo del evento o de la reserva
|
||||
if (inscription.reservationId){
|
||||
console.log('>>>>>>>>>>>>>>Voy a actualizar aforo reserva');
|
||||
console.log('>>>>>>>>>>>>>> ', NewConfirmed);
|
||||
if (!await eventReservationService._updateConfirmedReservation(EventOrReservationChangeId, NewConfirmed))
|
||||
return handleResultResponse("Error al eliminar inscripción, no puedo cambiar confirmados a la reserva asociada", null, params, res, httpStatus.NOT_FOUND);
|
||||
}
|
||||
else {
|
||||
console.log('>>>>>>>>>>>>>>Voy a actualizar aforo evento');
|
||||
console.log('>>>>>>>>>>>>>> ', NewConfirmed);
|
||||
if (!await eventService._updateConfirmedEvent(EventOrReservationChangeId, NewConfirmed))
|
||||
return handleResultResponse("Error al eliminar inscripción, no puedo cambiar confirmados a la inscripcion", null, params, res, httpStatus.NOT_FOUND);
|
||||
|
||||
@ -448,7 +452,6 @@ console.log('No se ha podido actualizar el aforo del evento');
|
||||
}
|
||||
|
||||
|
||||
|
||||
const marketingListOfInscription = dataInscription.event.marketing_list;
|
||||
/*AHORA SE ALMACENA TODO EN UNA ÚNICA LISTA DE MAILCHIMP, QUE ES LA DEL EVENTO
|
||||
(si en un futuro se quiere tener listas independientes, bastaría con tratarlo aqui los campos de marketinglist de la reserva ...)
|
||||
@ -459,6 +462,7 @@ console.log('No se ha podido actualizar el aforo del evento');
|
||||
else
|
||||
marketingListOfInscription = dataInscription.event.marketingList;
|
||||
*/
|
||||
|
||||
//Creamos objeto member para facilitar inserción en mailchimp y envio de correo
|
||||
var member = {
|
||||
marketing_memberId: null,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user