fix: #6184 Minor changes
This commit is contained in:
parent
567e480e3b
commit
7c80a7bdda
|
@ -13,21 +13,6 @@ module.exports = Self => {
|
||||||
description: 'The ticket id',
|
description: 'The ticket id',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
returns: [
|
|
||||||
{
|
|
||||||
arg: 'body',
|
|
||||||
type: 'file',
|
|
||||||
root: true
|
|
||||||
}, {
|
|
||||||
arg: 'Content-Type',
|
|
||||||
type: 'string',
|
|
||||||
http: {target: 'header'}
|
|
||||||
}, {
|
|
||||||
arg: 'Content-Disposition',
|
|
||||||
type: 'string',
|
|
||||||
http: {target: 'header'}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
http: {
|
http: {
|
||||||
path: '/cmrEmail',
|
path: '/cmrEmail',
|
||||||
verb: 'POST'
|
verb: 'POST'
|
||||||
|
@ -88,7 +73,7 @@ module.exports = Self => {
|
||||||
const response = await models.Dms.downloadFile(ctx, dms.id);
|
const response = await models.Dms.downloadFile(ctx, dms.id);
|
||||||
const email = new Email('cmr', params);
|
const email = new Email('cmr', params);
|
||||||
|
|
||||||
return email.send({
|
await email.send({
|
||||||
overrideAttachments: true,
|
overrideAttachments: true,
|
||||||
attachments: [{
|
attachments: [{
|
||||||
filename: `${ticket.cmrFk}.pdf`,
|
filename: `${ticket.cmrFk}.pdf`,
|
||||||
|
@ -97,7 +82,6 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (tx) await tx.commit();
|
if (tx) await tx.commit();
|
||||||
return;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (tx) await tx.rollback();
|
if (tx) await tx.rollback();
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue