u
This commit is contained in:
@@ -16,6 +16,9 @@ export default function create(provider) {
|
||||
* // => 1
|
||||
*/
|
||||
return async (rate, tx) => {
|
||||
if (typeof rate !== 'number' || !Number.isFinite(rate) || rate < 0) {
|
||||
throw new Error('Invalid tax rate');
|
||||
}
|
||||
const result = await makeRunner(provider, tx).query(sql, { rate });
|
||||
return result.rows[0]?.id ?? result.insertId;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user