module.exports = Self => { Self.remoteMethodCtx('previousLabel', { description: 'Returns the previa label pdf', accessType: 'READ', accepts: [ { arg: 'id', type: 'number', required: true, description: 'The item id', http: {source: 'path'} }], 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/previousLabel', verb: 'GET' } }); Self.previousLabel = (ctx, id) => Self.printReport(ctx, id, 'previa-label'); };