43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
module.exports = Self => {
|
|
Self.remoteMethodCtx('claimPickupPdf', {
|
|
description: 'Returns the claim pickup order pdf',
|
|
accepts: [
|
|
{
|
|
arg: 'id',
|
|
type: 'number',
|
|
required: true,
|
|
description: 'The claim id',
|
|
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/claim-pickup-pdf',
|
|
verb: 'GET'
|
|
},
|
|
accessScopes: ['DEFAULT', 'read:multimedia']
|
|
});
|
|
|
|
Self.claimPickupPdf = (ctx, id) => Self.printReport(ctx, id, 'claim-pickup-order');
|
|
};
|