Prettier
This commit is contained in:
parent
7124b06d67
commit
44ca51675b
@ -343,6 +343,7 @@ routes.delete(
|
|||||||
// Imagen del código QR de una inscripción
|
// Imagen del código QR de una inscripción
|
||||||
routes.get("/inscriptions/:id/qrimage", eventController.getQRCodeImage);
|
routes.get("/inscriptions/:id/qrimage", eventController.getQRCodeImage);
|
||||||
|
|
||||||
|
// Comprobar el código de invitación
|
||||||
routes.get(
|
routes.get(
|
||||||
"/events/:id/reservations/:encodedInvitationCode",
|
"/events/:id/reservations/:encodedInvitationCode",
|
||||||
isLoggedUser,
|
isLoggedUser,
|
||||||
|
|||||||
@ -17,7 +17,7 @@ const {
|
|||||||
} = require("../../helpers/controller.helper");
|
} = require("../../helpers/controller.helper");
|
||||||
const emailHelper = require("../../helpers/mail.helper");
|
const emailHelper = require("../../helpers/mail.helper");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const responseTime = require("response-time");
|
const responseTime = require("response-time");
|
||||||
|
|
||||||
// Module Name
|
// Module Name
|
||||||
const MODULE_NAME = "[eventReservation.controller]";
|
const MODULE_NAME = "[eventReservation.controller]";
|
||||||
@ -28,12 +28,10 @@ const controllerOptions = { MODULE_NAME };
|
|||||||
* Devuelve la reserva pasada por parametro publicada (publish) o null en el caso de error
|
* Devuelve la reserva pasada por parametro publicada (publish) o null en el caso de error
|
||||||
*/
|
*/
|
||||||
async function activeReservation(reservation) {
|
async function activeReservation(reservation) {
|
||||||
if (!reservation)
|
if (!reservation) throw new Error("activeReservation: reservation should be an object");
|
||||||
throw new Error("activeReservation: reservation should be an object");
|
|
||||||
|
|
||||||
//En el caso de ya estar publicada no hacemos nada se devuelve tal cual
|
//En el caso de ya estar publicada no hacemos nada se devuelve tal cual
|
||||||
if (reservation.state === 'publish')
|
if (reservation.state === "publish") return reservation;
|
||||||
return reservation;
|
|
||||||
|
|
||||||
await eventService._updateAforoOfEventReservation(reservation, reservation.assistants);
|
await eventService._updateAforoOfEventReservation(reservation, reservation.assistants);
|
||||||
|
|
||||||
@ -47,26 +45,28 @@ async function activeReservation(reservation) {
|
|||||||
reservation.state = "publish";
|
reservation.state = "publish";
|
||||||
|
|
||||||
//Finalmente hay que validar la inscripción del tutor en el caso de aquellos centros que no son aliados
|
//Finalmente hay que validar la inscripción del tutor en el caso de aquellos centros que no son aliados
|
||||||
if ((await eventInscriptionService._validateInscriptionTutorOfReservation(reservation.id, reservation.userId)) <= 0) {
|
if (
|
||||||
|
(await eventInscriptionService._validateInscriptionTutorOfReservation(reservation.id, reservation.userId)) <= 0
|
||||||
|
) {
|
||||||
//En el caso de ser un centro aliado no se puede validar la inscripcion ya que se hace a posteriori por lo tanto no se hace nada
|
//En el caso de ser un centro aliado no se puede validar la inscripcion ya que se hace a posteriori por lo tanto no se hace nada
|
||||||
// console.log("No se ha podido validar la inscripción del tutor por ser de un centro aliado se hace a posteriori en este caso");
|
// console.log("No se ha podido validar la inscripción del tutor por ser de un centro aliado se hace a posteriori en este caso");
|
||||||
// return null;
|
// return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('reservation.userId>>>>>> ', reservation.userId);
|
console.log("reservation.userId>>>>>> ", reservation.userId);
|
||||||
//Mandamos el código de reserva para que registra a sus alumnos
|
//Mandamos el código de reserva para que registra a sus alumnos
|
||||||
const user = await userService._getUserById(reservation.userId);
|
const user = await userService._getUserById(reservation.userId);
|
||||||
reservation.contact_email = user.email;
|
reservation.contact_email = user.email;
|
||||||
reservation.contact_name = user.name;
|
reservation.contact_name = user.name;
|
||||||
console.log('reservation.userId>>>>>> ', user.email);
|
console.log("reservation.userId>>>>>> ", user.email);
|
||||||
console.log('reservation.userId>>>>>> ', user.email);
|
console.log("reservation.userId>>>>>> ", user.email);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
console.log('envio correo>>>>>>>>>>> ', user);
|
console.log("envio correo>>>>>>>>>>> ", user);
|
||||||
mailService.sendReservationCollegeEmail(reservation);
|
mailService.sendReservationCollegeEmail(reservation);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
};
|
}
|
||||||
|
|
||||||
return reservation;
|
return reservation;
|
||||||
}
|
}
|
||||||
@ -75,8 +75,8 @@ async function activeReservation(reservation) {
|
|||||||
async function activeReservationById(id) {
|
async function activeReservationById(id) {
|
||||||
//Buscar reserva con evento y entidad
|
//Buscar reserva con evento y entidad
|
||||||
let reservation = await eventReservationService._getReservaByIdWithEntityAndEvent(id);
|
let reservation = await eventReservationService._getReservaByIdWithEntityAndEvent(id);
|
||||||
if (await activeReservation(reservation) === null) {
|
if ((await activeReservation(reservation)) === null) {
|
||||||
console.log("Error activeReservationById")
|
console.log("Error activeReservationById");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -111,16 +111,14 @@ const extraControllers = {
|
|||||||
const eventId = params.params.id;
|
const eventId = params.params.id;
|
||||||
const userId = req.user.id;
|
const userId = req.user.id;
|
||||||
let entityType = null;
|
let entityType = null;
|
||||||
let entityId = null
|
let entityId = null;
|
||||||
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 1 ', params.params.typeOrId);
|
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 1 ', params.params.typeOrId);
|
||||||
//typeOrId puede ser college, partner o el id de la entidad de la reserva
|
//typeOrId puede ser college, partner o el id de la entidad de la reserva
|
||||||
const typeOrId = params.params.typeOrId;
|
const typeOrId = params.params.typeOrId;
|
||||||
if (typeOrId !== null) {
|
if (typeOrId !== null) {
|
||||||
if ((typeOrId === "colleges") || (params.params.typeOrId === "partners"))
|
if (typeOrId === "colleges" || params.params.typeOrId === "partners") entityType = typeOrId;
|
||||||
entityType = typeOrId
|
else entityId = typeOrId;
|
||||||
else
|
}
|
||||||
entityId = typeOrId;
|
|
||||||
};
|
|
||||||
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 2 ', entityId);
|
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 2 ', entityId);
|
||||||
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 3 ', entityType);
|
// console.log('params.params.typeOrId>>>>++++++++++++++++++++++++++ 3 ', entityType);
|
||||||
|
|
||||||
@ -153,7 +151,10 @@ const extraControllers = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (reservation.Entity.contact_email)
|
if (reservation.Entity.contact_email)
|
||||||
emailHelper.sendReservationCode(mailService.generateHeaderMailReservation(reservation), mailService.generateBodyMailReservation(reservation));
|
emailHelper.sendReservationCode(
|
||||||
|
mailService.generateHeaderMailReservation(reservation),
|
||||||
|
mailService.generateBodyMailReservation(reservation)
|
||||||
|
);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// console.log(error);
|
// console.log(error);
|
||||||
console.log("No se ha podido mandar email con los códigos de invitación");
|
console.log("No se ha podido mandar email con los códigos de invitación");
|
||||||
@ -186,7 +187,10 @@ const extraControllers = {
|
|||||||
console.log("mando correo: ", reservation.Entity.name);
|
console.log("mando correo: ", reservation.Entity.name);
|
||||||
if (reservation.Entity.contact_email && reservation.Entity.contact_email.length !== 0) {
|
if (reservation.Entity.contact_email && reservation.Entity.contact_email.length !== 0) {
|
||||||
console.log("correo: ", reservation.Entity.contact_email);
|
console.log("correo: ", reservation.Entity.contact_email);
|
||||||
emailHelper.sendReservationCode(mailService.generateHeaderMailReservation(reservation), mailService.generateBodyMailReservation(reservation));
|
emailHelper.sendReservationCode(
|
||||||
|
mailService.generateHeaderMailReservation(reservation),
|
||||||
|
mailService.generateBodyMailReservation(reservation)
|
||||||
|
);
|
||||||
result =
|
result =
|
||||||
result +
|
result +
|
||||||
"Invitación con código " +
|
"Invitación con código " +
|
||||||
@ -270,7 +274,6 @@ const extraControllers = {
|
|||||||
console.log(">>>>>>>>>>>>>>>>>>>> createReservationToEntity>>>>>>", dataInscription.type);
|
console.log(">>>>>>>>>>>>>>>>>>>> createReservationToEntity>>>>>>", dataInscription.type);
|
||||||
//Si viene group_size crearemos un código de reserva
|
//Si viene group_size crearemos un código de reserva
|
||||||
if (dataInscription.groupSize > 1) {
|
if (dataInscription.groupSize > 1) {
|
||||||
|
|
||||||
if (!dataUser.entityId) {
|
if (!dataUser.entityId) {
|
||||||
return handleResultResponse(
|
return handleResultResponse(
|
||||||
"Error No es posible crear reserva grupal si no pertences a una entidad educativa",
|
"Error No es posible crear reserva grupal si no pertences a una entidad educativa",
|
||||||
@ -278,14 +281,14 @@ const extraControllers = {
|
|||||||
params,
|
params,
|
||||||
res,
|
res,
|
||||||
httpStatus.NOT_FOUND
|
httpStatus.NOT_FOUND
|
||||||
)
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
const reservationData = {
|
const reservationData = {
|
||||||
reservation_code: eventReservationService._generateReservatioCode(dataInscription.event, dataUser.entityName),
|
reservation_code: eventReservationService._generateReservatioCode(dataInscription.event, dataUser.entityName),
|
||||||
state: "draft", //sin confirmar, publish es cuando se descuenta del aforo del evento
|
state: "draft", //sin confirmar, publish es cuando se descuenta del aforo del evento
|
||||||
color: "orange",
|
color: "orange",
|
||||||
description: (dataInscription.type === 'online group') ? 'Incripción online en grupo' : 'Reserva',
|
description: dataInscription.type === "online group" ? "Incripción online en grupo" : "Reserva",
|
||||||
init_available_date: dataInscription.event.init_available_date,
|
init_available_date: dataInscription.event.init_available_date,
|
||||||
end_available_date: dataInscription.event.end_available_date,
|
end_available_date: dataInscription.event.end_available_date,
|
||||||
entityId: dataUser.entityId,
|
entityId: dataUser.entityId,
|
||||||
@ -303,10 +306,16 @@ const extraControllers = {
|
|||||||
if (plazasDisponibles < reservationData.assistants)
|
if (plazasDisponibles < reservationData.assistants)
|
||||||
if (dataInscription.event.allow_overflow) {
|
if (dataInscription.event.allow_overflow) {
|
||||||
reservationData.overflowEventId = dataInscription.event.overflow_eventId;
|
reservationData.overflowEventId = dataInscription.event.overflow_eventId;
|
||||||
reservationData.description = reservationData.description + ' en lista de espera'
|
reservationData.description = reservationData.description + " en lista de espera";
|
||||||
console.log('Asigno lista de espera>>>>>>>>>>>>>>>>>>>>>>>', reservationData.eventId);
|
console.log("Asigno lista de espera>>>>>>>>>>>>>>>>>>>>>>>", reservationData.eventId);
|
||||||
}
|
} else
|
||||||
else return handleResultResponse("Aforo lleno no es posible efectuar la reserva", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse(
|
||||||
|
"Aforo lleno no es posible efectuar la reserva",
|
||||||
|
null,
|
||||||
|
params,
|
||||||
|
res,
|
||||||
|
httpStatus.NOT_FOUND
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
///Aqui podríamos validar si ya hay reserva y dar error ya que no pueden meter codigo de reserva y darnos un group_size superior a 1.
|
///Aqui podríamos validar si ya hay reserva y dar error ya que no pueden meter codigo de reserva y darnos un group_size superior a 1.
|
||||||
@ -318,8 +327,7 @@ const extraControllers = {
|
|||||||
dataInscription.reservation = dataInscription.reservation.toJSON();
|
dataInscription.reservation = dataInscription.reservation.toJSON();
|
||||||
res.locals.dataInscription = dataInscription;
|
res.locals.dataInscription = dataInscription;
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>RESERVATION CREADA", dataInscription.reservation);
|
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>RESERVATION CREADA", dataInscription.reservation);
|
||||||
}
|
} else console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>no hago nada");
|
||||||
else console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>no hago nada");
|
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -341,14 +349,15 @@ const extraControllers = {
|
|||||||
console.log(">> No se aplica descuento de aforo");
|
console.log(">> No se aplica descuento de aforo");
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
|
|
||||||
//En caso de ser una inscripción normal o una reserva ya publicada no descontamos ningun aforo al evento
|
//En caso de ser una inscripción normal o una reserva ya publicada no descontamos ningun aforo al evento
|
||||||
if (!dataInscription.reservation || (dataInscription.reservation.state === 'publish')) { // || (!dataInscription.reservationCode) || (dataInscription.reservationCode === "")) {
|
if (!dataInscription.reservation || dataInscription.reservation.state === "publish") {
|
||||||
|
// || (!dataInscription.reservationCode) || (dataInscription.reservationCode === "")) {
|
||||||
console.log(">> No se aplica descuento de aforo ya que es una reserva publicada");
|
console.log(">> No se aplica descuento de aforo ya que es una reserva publicada");
|
||||||
next();
|
next();
|
||||||
return;
|
return;
|
||||||
};
|
}
|
||||||
|
|
||||||
//Si es centro aliado
|
//Si es centro aliado
|
||||||
if (dataUser.entityLevel === "aliado") {
|
if (dataUser.entityLevel === "aliado") {
|
||||||
@ -361,9 +370,10 @@ const extraControllers = {
|
|||||||
null,
|
null,
|
||||||
params,
|
params,
|
||||||
res,
|
res,
|
||||||
httpStatus.NOT_FOUND);
|
httpStatus.NOT_FOUND
|
||||||
|
);
|
||||||
else dataInscription.reservation = reservationPublicada;
|
else dataInscription.reservation = reservationPublicada;
|
||||||
};
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
@ -378,9 +388,12 @@ const extraControllers = {
|
|||||||
let result = await activeReservationById(idResevation);
|
let result = await activeReservationById(idResevation);
|
||||||
return handleResultResponse(result, null, params, res, httpStatus.OK);
|
return handleResultResponse(result, null, params, res, httpStatus.OK);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('********************************************************************************************', error);
|
console.log(
|
||||||
|
"********************************************************************************************",
|
||||||
|
error
|
||||||
|
);
|
||||||
//return handleResultResponse("Error al buscar las reservas", null, params, res, httpStatus.NOT_FOUND);
|
//return handleResultResponse("Error al buscar las reservas", null, params, res, httpStatus.NOT_FOUND);
|
||||||
return handleErrorResponse('activarReservation', 'methodName', error.stack, res);
|
return handleErrorResponse("activarReservation", "methodName", error.stack, res);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -390,29 +403,28 @@ const extraControllers = {
|
|||||||
if (!idResevation)
|
if (!idResevation)
|
||||||
return handleResultResponse("Error id de reservation necesario", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse("Error id de reservation necesario", null, params, res, httpStatus.NOT_FOUND);
|
||||||
|
|
||||||
const eventReservation = await eventReservationService._getReservaById(idResevation);
|
const eventReservation = await eventReservationService._getReservaById(idResevation);
|
||||||
if (!eventReservation)
|
if (!eventReservation)
|
||||||
return handleResultResponse("Error reserva no existente", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse("Error reserva no existente", null, params, res, httpStatus.NOT_FOUND);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//Antes de borrar una reserva debemos borrar todas las inscripciones asociadas.
|
//Antes de borrar una reserva debemos borrar todas las inscripciones asociadas.
|
||||||
eventInscriptionService._deleteInscriptionsByReservation(eventReservation.id);
|
eventInscriptionService._deleteInscriptionsByReservation(eventReservation.id);
|
||||||
if (eventReservation.state === 'publish'){
|
if (eventReservation.state === "publish") {
|
||||||
const cantidad = -1 * eventReservation.assistants;
|
const cantidad = -1 * eventReservation.assistants;
|
||||||
eventService._updateAforoOfEventReservation(eventReservation, cantidad);
|
eventService._updateAforoOfEventReservation(eventReservation, cantidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
let result = eventReservationService._deleteReservation(eventReservation.id);
|
let result = eventReservationService._deleteReservation(eventReservation.id);
|
||||||
return handleResultResponse(result, null, params, res, httpStatus.OK);
|
return handleResultResponse(result, null, params, res, httpStatus.OK);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return handleResultResponse("Error al eliminar la reserva", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse("Error al eliminar la reserva", null, params, res, httpStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**** Modifica una reserva, si está publicada, actualiza la diferenecia de los asistentes, en el caso de ser modificado, en el aforo del evento (assitants).
|
/**** Modifica una reserva, si está publicada, actualiza la diferenecia de los asistentes, en el caso de ser modificado, en el aforo del evento (assitants).
|
||||||
*/
|
*/
|
||||||
checkAssitantsUpdate: async (req, res, next) => {
|
checkAssitantsUpdate: async (req, res, next) => {
|
||||||
const params = extractParamsFromRequest(req, res, {});
|
const params = extractParamsFromRequest(req, res, {});
|
||||||
const idResevation = params.params.id;
|
const idResevation = params.params.id;
|
||||||
const NewReservarionAssistants = req.body.assistants;
|
const NewReservarionAssistants = req.body.assistants;
|
||||||
@ -425,23 +437,27 @@ const extraControllers = {
|
|||||||
return handleResultResponse("Error reserva no existente", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse("Error reserva no existente", null, params, res, httpStatus.NOT_FOUND);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (eventReservation.state === 'publish' && eventReservation.assistants != NewReservarionAssistants) {
|
if (eventReservation.state === "publish" && eventReservation.assistants != NewReservarionAssistants) {
|
||||||
|
if (NewReservarionAssistants < eventReservation.confirmed) {
|
||||||
|
return handleResultResponse(
|
||||||
|
"Error el número de asistentes no puede ser menor que el de confirmados",
|
||||||
|
null,
|
||||||
|
params,
|
||||||
|
res,
|
||||||
|
httpStatus.NOT_FOUND
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (NewReservarionAssistants < eventReservation.confirmed) {
|
const cantidad = NewReservarionAssistants - eventReservation.assistants;
|
||||||
return handleResultResponse("Error el número de asistentes no puede ser menor que el de confirmados", null, params, res, httpStatus.NOT_FOUND);
|
await eventService._updateAforoOfEventReservation(eventReservation, cantidad);
|
||||||
};
|
|
||||||
|
|
||||||
const cantidad = (NewReservarionAssistants - eventReservation.assistants);
|
|
||||||
await eventService._updateAforoOfEventReservation(eventReservation, cantidad);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//console.log('checkAssitantsUpdate >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', error.stack);
|
//console.log('checkAssitantsUpdate >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', error.stack);
|
||||||
return handleErrorResponse('controllerName', 'methodName', error.stack, res);
|
return handleErrorResponse("controllerName", "methodName", error.stack, res);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////
|
||||||
//Esta función se llama desde APP y desde WEB
|
//Esta función se llama desde APP y desde WEB
|
||||||
@ -486,10 +502,13 @@ const extraControllers = {
|
|||||||
) {
|
) {
|
||||||
dataInscription.validated = false;
|
dataInscription.validated = false;
|
||||||
//Es la inscripción automática del tutor o alguien que tiene el código y eso no puede ser
|
//Es la inscripción automática del tutor o alguien que tiene el código y eso no puede ser
|
||||||
if (dataInscription.type === "online" || dataInscription.type === "online group" || dataInscription.reservation.state === 'publish')
|
if (
|
||||||
|
dataInscription.type === "online" ||
|
||||||
|
dataInscription.type === "online group" ||
|
||||||
|
dataInscription.reservation.state === "publish"
|
||||||
|
)
|
||||||
dataInscription.validated = true;
|
dataInscription.validated = true;
|
||||||
|
|
||||||
|
|
||||||
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", dataInscription.type);
|
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", dataInscription.type);
|
||||||
//Actualizamos aforo de la lista de espera de la reserva y creamos inscripcion en la lista de espera de la reserva
|
//Actualizamos aforo de la lista de espera de la reserva y creamos inscripcion en la lista de espera de la reserva
|
||||||
if (
|
if (
|
||||||
@ -570,16 +589,19 @@ const extraControllers = {
|
|||||||
...Result,
|
...Result,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Incluimos correo en sendinblue
|
// Incluimos correo en sendinblue
|
||||||
try {
|
try {
|
||||||
// marketingListService.addMarketingList(dataUser, dataInscription);
|
// marketingListService.addMarketingList(dataUser, dataInscription);
|
||||||
} catch (error) { console.log('Se ha producido un error al añadir a SenINBlue>>>>>>>>>>>>>>>>><<', error); }
|
} catch (error) {
|
||||||
|
console.log("Se ha producido un error al añadir a SenINBlue>>>>>>>>>>>>>>>>><<", error);
|
||||||
|
}
|
||||||
|
|
||||||
//Mandamos correo con entrada o lista de espera
|
//Mandamos correo con entrada o lista de espera
|
||||||
try {
|
try {
|
||||||
mailService.sendEmailConfirm(dataUser, dataInscription);
|
mailService.sendEmailConfirm(dataUser, dataInscription);
|
||||||
} catch (error) { console.log('Se ha producido un error al enviar mail>>>>>>>>>>>>>>>>><<', error); }
|
} catch (error) {
|
||||||
|
console.log("Se ha producido un error al enviar mail>>>>>>>>>>>>>>>>><<", error);
|
||||||
|
}
|
||||||
|
|
||||||
return handleResultResponse(Result, null, params, res, httpStatus.CREATED);
|
return handleResultResponse(Result, null, params, res, httpStatus.CREATED);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user