.
This commit is contained in:
parent
6c41d5eec3
commit
a6a1c3f0f1
@ -17,8 +17,8 @@ module.exports.getInscriptionQRCodeUrl = function (inscriptionId) {
|
|||||||
|
|
||||||
} */
|
} */
|
||||||
|
|
||||||
module.exports.getInscriptionQRCode = function (params) {
|
module.exports.getInscriptionQRCode = async function (params) {
|
||||||
return new Promise(function (resolve, reject) {
|
const result = new Promise(function (resolve, reject) {
|
||||||
var texto = _.padStart(params.code, 4, '0') + '\n' + moment(params.date).format('DD/MM/YY HH:mm ') + params.name + ' ' + params.surname;
|
var texto = _.padStart(params.code, 4, '0') + '\n' + moment(params.date).format('DD/MM/YY HH:mm ') + params.name + ' ' + params.surname;
|
||||||
var options = {
|
var options = {
|
||||||
errorCorrectionLevel: 'M',
|
errorCorrectionLevel: 'M',
|
||||||
@ -45,7 +45,9 @@ module.exports.getInscriptionQRCode = function (params) {
|
|||||||
resolve(qrcode);
|
resolve(qrcode);
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
})
|
});
|
||||||
|
|
||||||
|
return await result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ const userService = require('../auth/user.service');
|
|||||||
const MODULE_NAME = '[event.controller]';
|
const MODULE_NAME = '[event.controller]';
|
||||||
const controllerOptions = { MODULE_NAME };
|
const controllerOptions = { MODULE_NAME };
|
||||||
|
|
||||||
async function generateMemberInscription (user, inscription, reservation) {
|
function generateMemberInscription (user, inscription, reservation) {
|
||||||
let memberInscription = null;
|
let memberInscription = null;
|
||||||
if (user && inscription) {
|
if (user && inscription) {
|
||||||
memberInscription = {
|
memberInscription = {
|
||||||
@ -49,7 +49,7 @@ async function generateMemberInscription (user, inscription, reservation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
memberInscription.qrConfig = generateQRConfig(memberInscription);
|
memberInscription.qrConfig = generateQRConfig(memberInscription);
|
||||||
memberInscription.qrCode = await QRHelper.getInscriptionQRCode(memberInscription.qrConfig);
|
memberInscription.qrCode = QRHelper.getInscriptionQRCode(memberInscription.qrConfig);
|
||||||
memberInscription.qrCodeUrl = QRHelper.getInscriptionQRCodeUrl(inscription.id);
|
memberInscription.qrCodeUrl = QRHelper.getInscriptionQRCodeUrl(inscription.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user