salix/modules/entry/back/methods/entry/entryOrderPdf.js

42 lines
1.1 KiB
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('entryOrderPdf', {
description: 'Returns the entry order pdf',
accepts: [
{
arg: 'id',
type: 'number',
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: '/:id/entry-order-pdf',
verb: 'GET'
},
accessScopes: ['read:multimedia']
});
Self.entryOrderPdf = (ctx, id) => Self.printReport(ctx, id, 'entry-order');
};