salix/modules/invoiceOut/back/methods/invoiceOut/exportationPdf.js

43 lines
1.2 KiB
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('exportationPdf', {
description: 'Returns the exportation pdf',
accessType: 'READ',
accepts: [
{
arg: 'reference',
type: 'string',
required: true,
http: {source: 'path'}
},
{
arg: 'recipientId',
type: 'number',
description: 'The recipient id',
required: false
}
],
returns: [
{
arg: 'body',
type: 'file',
root: true
}, {
arg: 'Content-Type',
type: 'String',
http: {target: 'header'}
}, {
arg: 'Content-Disposition',
type: 'String',
http: {target: 'header'}
}
],
http: {
path: '/:reference/exportation-pdf',
verb: 'GET'
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.exportationPdf = (ctx, reference) => Self.printReport(ctx, reference, 'exportation');
};