salix/modules/route/back/methods/cmr/print.js

38 lines
983 B
JavaScript
Raw Normal View History

2023-08-02 05:35:40 +00:00
module.exports = Self => {
2024-11-12 07:25:23 +00:00
Self.remoteMethodCtx('print', {
description: 'Returns the cmr pdf',
2023-08-02 05:35:40 +00:00
accessType: 'READ',
accepts: [
{
arg: 'id',
type: 'number',
required: true,
description: 'The cmr 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: {
2024-11-12 07:25:23 +00:00
path: '/:id/print',
2023-08-02 05:35:40 +00:00
verb: 'GET'
},
accessScopes: ['DEFAULT', 'read:multimedia']
2023-08-02 05:35:40 +00:00
});
2024-11-12 07:25:23 +00:00
Self.print = (ctx, id) => Self.printReport(ctx, id, 'cmr');
2023-08-02 05:35:40 +00:00
};