salix/modules/route/back/methods/route/driverRoutePdf.js

42 lines
1.1 KiB
JavaScript

module.exports = Self => {
Self.remoteMethodCtx('driverRoutePdf', {
description: 'Returns the driver route pdf',
accepts: [
{
arg: 'id',
type: 'string',
required: true,
description: 'The route 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/driver-route-pdf',
verb: 'GET'
}
});
Self.driverRoutePdf = (ctx, id) => Self.printReport(ctx, id, 'driver-route');
};