From 707c4f9e8d90433f2752903bf707dae5f6b52b15 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Fri, 14 Jun 2024 16:51:26 +0530 Subject: [PATCH] [WEB-522] chore: handled numeric validation on estimate point update in categories (#4819) * dev: handled numeric validation on estimate point update * chore: updated number comparision in estimate category type --- web/core/components/estimates/points/create.tsx | 2 +- web/core/components/estimates/points/update.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/core/components/estimates/points/create.tsx b/web/core/components/estimates/points/create.tsx index e9a7e35dc..4a0967aa0 100644 --- a/web/core/components/estimates/points/create.tsx +++ b/web/core/components/estimates/points/create.tsx @@ -86,7 +86,7 @@ export const EstimatePointCreate: FC = observer((props) => isEstimateValid = true; } } else if (currentEstimateType && currentEstimateType === EEstimateSystem.CATEGORIES) { - if (estimateInputValue && estimateInputValue.length > 0 && Number(estimateInputValue) < 0) { + if (estimateInputValue && estimateInputValue.length > 0 && isNaN(Number(estimateInputValue))) { isEstimateValid = true; } } diff --git a/web/core/components/estimates/points/update.tsx b/web/core/components/estimates/points/update.tsx index e20cbcfb1..4194f4b2d 100644 --- a/web/core/components/estimates/points/update.tsx +++ b/web/core/components/estimates/points/update.tsx @@ -91,7 +91,7 @@ export const EstimatePointUpdate: FC = observer((props) => isEstimateValid = true; } } else if (currentEstimateType && currentEstimateType === EEstimateSystem.CATEGORIES) { - if (estimateInputValue && estimateInputValue.length > 0) { + if (estimateInputValue && estimateInputValue.length > 0 && isNaN(Number(estimateInputValue))) { isEstimateValid = true; } }