u
This commit is contained in:
@@ -8,7 +8,7 @@ import { pngToZpl } from '../../services/zplService.js';
|
||||
import { notifyAgentJob } from '../agent/index.js';
|
||||
import { emit } from '../sse.js';
|
||||
import { applyZplCopies } from './zpljob.js';
|
||||
import { interpolateString, interpolateObjects } from './article/shared.js';
|
||||
import { interpolateString, interpolateObjects, withMandatedOptionsPrice } from './article/shared.js';
|
||||
|
||||
// #region Helpers
|
||||
|
||||
@@ -102,7 +102,7 @@ export function register(app, basePath = '') {
|
||||
const skuStr = String(req.query.sku).trim();
|
||||
const result = await articleDb.getBySku(req.user.id, skuStr);
|
||||
if (result?.article) {
|
||||
article = result.article;
|
||||
article = await withMandatedOptionsPrice(req.user.id, result.article);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ export function register(app, basePath = '') {
|
||||
: null;
|
||||
if (objects && objects.length > 0) {
|
||||
try {
|
||||
const interpolated = interpolateObjects(objects, result.article);
|
||||
const interpolated = interpolateObjects(objects, await withMandatedOptionsPrice(req.user.id, result.article));
|
||||
const thumbBuffer = await renderThumb({
|
||||
width: template.width,
|
||||
height: template.height,
|
||||
@@ -655,7 +655,7 @@ export function register(app, basePath = '') {
|
||||
if (!result?.article) {
|
||||
return res.status(404).json({ error: 'Article not found' });
|
||||
}
|
||||
article = result.article;
|
||||
article = await withMandatedOptionsPrice(req.user.id, result.article);
|
||||
} else {
|
||||
article = {
|
||||
name: template?.name || 'Musterartikel',
|
||||
|
||||
Reference in New Issue
Block a user