u
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user