This commit is contained in:
seb
2026-09-30 22:37:40 +02:00
parent 3d2f8e9296
commit 74ed74fc68
19 changed files with 122 additions and 56 deletions

View File

@@ -53,8 +53,11 @@ export async function assertSupplier(runnerOrPool, txOrCompanyId, maybeCompanyId
supplierId = maybeCompanyId;
}
if (supplierId == null || !Number.isFinite(supplierId)) {
throw new Error('Supplier not found');
if (supplierId == null) {
throw new Error('supplierId is required');
}
if (typeof supplierId !== 'number' || !Number.isInteger(supplierId) || supplierId <= 0) {
throw new Error('Invalid supplierId');
}
const isSqlite = runner?.dialect === 'sqlite3';