This commit is contained in:
David Arranz 2022-09-12 10:56:52 +02:00
parent c22a469ae5
commit 5f4b7fc3f9
2 changed files with 67 additions and 71 deletions

View File

@ -147,23 +147,19 @@ const extraControllers = {
const userId = req.user.id;
var result = null;
//console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', params, req.user.level);
if (!eventId)
return handleResultResponse("Es necesario el ID del evento", null, params, res, httpStatus.NOT_FOUND);
try {
if (req.user.level === 8) result = await eventInscriptionService._getInscriptionOnlineByEvent(eventId);
result = await eventInscriptionService._getInscriptionOnlineByEvent(eventId);
//No se le llamará nunca desde la app, la app trata todas las incripciopnes como normales
// else result = await eventInscriptionService._getInscriptionByEventAndUser(eventId, userId);
return handleResultResponse(result, null, params, res, result === null ? httpStatus.NOT_FOUND : httpStatus.OK);
} catch (error) {
return handleErrorResponse(MODULE_NAME, "getInscriptionsOnline", error, res);
}
},

View File

@ -4,7 +4,7 @@ const eventInscriptionService = require("./events_inscriptions.service");
const marketing = require("../../helpers/sendinblue.helper");
////////////////////////////////////////////////////////////////////
// dataInscription {incription:{...}, {..., event:{...}, reservation:{...}, user:{...}}
// dataInscription {incription:{...}, event:{...}, reservation:{...}, user:{...}}
////////////////////////////////////////////////////////////////////
/*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 ...)
@ -17,10 +17,10 @@ const marketing = require("../../helpers/sendinblue.helper");
*/
function _generateMarketingDTO(dataInscription) {
let inscriptionDTO = {};
console.log('entro>>> ', dataInscription);
let inscription = dataInscription.inscription ? dataInscription.inscription : dataInscription;
console.log('entro>>>', inscription);
console.log('inscripción>>> ', inscription);
if (inscription) {
inscriptionDTO.id = inscription.id;
inscriptionDTO.source = inscription.source;