8267-devToTest #3270

Merged
alexm merged 131 commits from 8267-devToTest into test 2024-12-03 12:18:21 +00:00
2 changed files with 5 additions and 5 deletions
Showing only changes of commit 71bc1adcba - Show all commits

View File

@ -1,6 +1,6 @@
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethodCtx('print', {
Self.remoteMethodCtx('labelSupplier', {
description: 'Print stickers of all entries',
accessType: 'READ',
accepts: [
@ -28,13 +28,13 @@ module.exports = Self => {
}
],
http: {
path: '/:id/print',
path: '/:id/labelSupplier',
verb: 'GET'
},
accessScopes: ['DEFAULT', 'read:multimedia']
});
Self.print = async function(ctx, id, options) {
Self.labelSupplier = async function(ctx, id, options) {
const models = Self.app.models;
const myOptions = {};
if (typeof options == 'object')
@ -49,7 +49,7 @@ module.exports = Self => {
if (buy.stickers < 1) continue;
ctx.args.id = buy.id;
ctx.args.copies = buy.stickers;
const pdfBuffer = await models.Entry.buyLabel(ctx, myOptions);
const pdfBuffer = await models.Entry.buyLabelSupplier(ctx, myOptions);
await merger.add(new Uint8Array(pdfBuffer[0]));
}

View File

@ -12,7 +12,7 @@ module.exports = Self => {
require('../methods/entry/addFromPackaging')(Self);
require('../methods/entry/addFromBuy')(Self);
require('../methods/entry/buyLabel')(Self);
require('../methods/entry/print')(Self);
require('../methods/entry/labelSupplier')(Self);
require('../methods/entry/buyLabelSupplier')(Self);
Self.observe('before save', async function(ctx, options) {