a
This commit is contained in:
parent
efd1a22bd9
commit
dde393649b
@ -518,23 +518,47 @@ console.log(headerMail, bodyMail);
|
|||||||
const inscriptionId = params.params.id;
|
const inscriptionId = params.params.id;
|
||||||
const userId = req.user.id;
|
const userId = req.user.id;
|
||||||
try {
|
try {
|
||||||
/*
|
|
||||||
const inscription = await eventInscriptionService._getInscriptionById(inscriptionId);
|
const inscription = await eventInscriptionService._getInscriptionById(inscriptionId);
|
||||||
if (!inscription) {
|
if (!inscription) //{
|
||||||
return handleResultResponse("Inscription no encontrada", null, params, res, httpStatus.NOT_FOUND);
|
return handleResultResponse("Inscription no encontrada", null, params, res, httpStatus.NOT_FOUND);
|
||||||
} else if (inscription.userId !== userId) {
|
// } else if (inscription.userId !== userId) {
|
||||||
return handleResultResponse("Inscription no encontrada", null, params, res, httpStatus.NOT_FOUND);
|
// return handleResultResponse("Inscription no encontrada", null, params, res, httpStatus.NOT_FOUND);
|
||||||
}
|
// }
|
||||||
|
|
||||||
const qrConfig = {
|
const qrConfig = {
|
||||||
name: req.user.name,
|
name: req.user.name,
|
||||||
surname: req.user.surname,
|
surname: req.user.surname,
|
||||||
date: inscription.date,
|
date: inscription.date,
|
||||||
code: inscription.code_ticket,
|
code: inscription.code_ticket,
|
||||||
color: (inscription.level && inscription.level.color) ? inscription.level.color : null,
|
color: (inscription.reservation) ? inscription.reservation.color : null,
|
||||||
}
|
}
|
||||||
const qrCode = await QRHelper.getInscriptionQRCode(qrConfig);
|
const qrCode = await QRHelper.getInscriptionQRCode(qrConfig);
|
||||||
|
|
||||||
|
console.log('<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<', req.user);
|
||||||
|
var headerMail = {
|
||||||
|
to: req.user.email,
|
||||||
|
name: req.user.name + ' ' + req.user.surname,
|
||||||
|
// subject: ((member.validated) ? 'Entrada' : 'Lista de espera') + ' para el congreso ' + dataInscription.event.name + ' confirmada'
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
var bodyMail = {
|
||||||
|
tipoEntrada: (member.validated) ? 'Entrada' : 'Lista de espera',
|
||||||
|
descriptionEntrada: member.description,
|
||||||
|
qrCode: qrCode,
|
||||||
|
color: qrConfig.color,
|
||||||
|
codeTicket: member.code_ticket,
|
||||||
|
eventName: dataInscription.event.name,
|
||||||
|
dateInscription: moment(dataInscription.event.init_date).format('D [de] MMMM [de] YYYY'),
|
||||||
|
}
|
||||||
|
console.log('Mandamos mail con entrada>>>>>>>>>>>>>>>>>>>>>>>>>>>');
|
||||||
|
console.log(headerMail, bodyMail);
|
||||||
|
if (member.validated)
|
||||||
|
emailHelper.sendTicket(headerMail, bodyMail)
|
||||||
|
else
|
||||||
|
emailHelper.sendListaEspera(headerMail, bodyMail);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return handleResultResponse(null, null, params, res, httpStatus.OK);
|
return handleResultResponse(null, null, params, res, httpStatus.OK);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -46,7 +46,7 @@ const extraMethods = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_getInscriptionByEventAndUser: (eventId, userId) => {
|
_getInscriptionByEventAndUser: (eventId, userId) => {
|
||||||
return models.EventInscription.scope('includeEventAndVenue').findOne({
|
return models.EventInscription.scope(['includeEventAndVenue', 'includeReservation']).findOne({
|
||||||
where: {
|
where: {
|
||||||
eventId: eventId,
|
eventId: eventId,
|
||||||
userId: userId
|
userId: userId
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user