u
This commit is contained in:
@@ -9,7 +9,7 @@ import {
|
||||
import resolveSelectedCompanyAccess from '../companyuser/resolveSelectedCompanyAccess.js';
|
||||
import makeRunner from '../runner.js';
|
||||
|
||||
const VALID_TYPES = new Set(['esc/pos', 'zpl']);
|
||||
const VALID_TYPES = new Set(['esc/pos', 'zpl', 'ipp']);
|
||||
|
||||
function shape(row) {
|
||||
return {
|
||||
@@ -43,7 +43,7 @@ export default function update(provider) {
|
||||
* @param {number} id - The printer ID to update.
|
||||
* @param {object} input - Update payload.
|
||||
* @param {string} [input.address] - The printer address.
|
||||
* @param {string} [input.type] - The printer type ("esc/pos" or "zpl").
|
||||
* @param {string} [input.type] - The printer type ("esc/pos", "zpl", or "ipp").
|
||||
* @param {string|null} [input.model] - The printer model.
|
||||
* @param {string|null} [input.serial] - The printer serial.
|
||||
* @param {number} [input.sort] - The sort order.
|
||||
@@ -80,7 +80,7 @@ export default function update(provider) {
|
||||
if (input.type !== undefined) {
|
||||
const cleaned = typeof input.type === 'string' ? input.type.trim() : '';
|
||||
if (!cleaned || !VALID_TYPES.has(cleaned)) {
|
||||
throw new Error('Invalid printer type: must be "esc/pos" or "zpl"');
|
||||
throw new Error('Invalid printer type: must be "esc/pos", "zpl", or "ipp"');
|
||||
}
|
||||
type = cleaned;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user