2022-11-21 12:31:55 +00:00
|
|
|
module.exports = Self => {
|
2022-12-22 07:00:18 +00:00
|
|
|
Self.remoteMethodCtx('previousLabel', {
|
2022-11-21 12:31:55 +00:00
|
|
|
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: {
|
2022-12-22 07:00:18 +00:00
|
|
|
path: '/:id/previousLabel',
|
2022-11-21 12:31:55 +00:00
|
|
|
verb: 'GET'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-03-14 07:17:46 +00:00
|
|
|
Self.previousLabel = (ctx, id) => Self.printReport(ctx, id, 'previa-label');
|
2022-11-21 12:31:55 +00:00
|
|
|
};
|