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'
|
2024-04-17 07:52:53 +00:00
|
|
|
},
|
2024-04-19 08:49:57 +00:00
|
|
|
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
|
|
|
};
|