From bcc4a6c4508228e94ad951d0703c6c48c266a004 Mon Sep 17 00:00:00 2001 From: Alisher Musurmonov Date: Fri, 27 Sep 2024 19:55:00 +0500 Subject: [PATCH] updated validation with number type conversion --- lib/utils/validateRequired.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/validateRequired.js b/lib/utils/validateRequired.js index a48de82f..0e677812 100644 --- a/lib/utils/validateRequired.js +++ b/lib/utils/validateRequired.js @@ -37,9 +37,9 @@ export function validateRequiredPositiveAmount(value) { } export function validatePositiveAmount(value) { - if (value !== '' || value === undefined || value === null) return undefined; + if (value === '' || value === undefined || value === null) return undefined; - return value > 0 + return Number(value) > 0 ? undefined : ; }