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 {
|
||||
@@ -42,7 +42,7 @@ export default function create(provider) {
|
||||
* @param {number} googleAuthId - The id of the Google auth user.
|
||||
* @param {object} input - Printer input.
|
||||
* @param {string} input.address - Printer address (network IP/host/path).
|
||||
* @param {string} input.type - Printer type ("esc/pos" or "zpl").
|
||||
* @param {string} input.type - Printer type ("esc/pos", "zpl", or "ipp").
|
||||
* @param {string} [input.model] - Optional printer model name.
|
||||
* @param {string} [input.serial] - Optional printer serial number.
|
||||
* @param {number} [input.sort] - Optional sort order (auto-increments if omitted).
|
||||
@@ -67,7 +67,7 @@ export default function create(provider) {
|
||||
|
||||
const type = typeof input.type === 'string' ? input.type.trim() : '';
|
||||
if (!type || !VALID_TYPES.has(type)) {
|
||||
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"');
|
||||
}
|
||||
|
||||
const runner = makeRunner(provider, tx);
|
||||
|
||||
@@ -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