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

@@ -6,8 +6,8 @@ export async function assertSupplier(provider, tx, companyId, supplierId) {
if (supplierId == null) {
return null;
}
if (!Number.isFinite(supplierId)) {
throw new Error('Supplier not found');
if (typeof supplierId !== 'number' || !Number.isInteger(supplierId) || supplierId <= 0) {
throw new Error('Invalid supplierId');
}
const isSqlite = provider?.dialect === 'sqlite3';