From 95813c58694200e852b451eb4714f3606820670d Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Fri, 5 Dec 2025 11:52:28 +0530 Subject: [PATCH] Planned Work now accepts values with up to 2 decimal places. --- src/components/Project/Infrastructure/EditActivityModal.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Project/Infrastructure/EditActivityModal.jsx b/src/components/Project/Infrastructure/EditActivityModal.jsx index 14e66020..088f0556 100644 --- a/src/components/Project/Infrastructure/EditActivityModal.jsx +++ b/src/components/Project/Infrastructure/EditActivityModal.jsx @@ -17,7 +17,7 @@ const taskSchema = z .object({ activityID: z.string().min(1, "Activity is required"), workCategoryId: z.string().min(1, "Work Category is required"), - plannedWork: z.number().min(1, "Planned Work must be greater than 0"), + plannedWork: z.number().min(0.01, "Planned Work must be greater than 0"), completedWork: z.number().min(0, "Completed Work must be ≥ 0"), comment: z.string(), }) @@ -107,6 +107,7 @@ const EditActivityModal = ({ const onSubmitForm = (data) => { const payload = { ...data, + plannedWork: Number(data.plannedWork.toFixed(2)), id: workItem?.workItem?.id ?? workItem?.id, buildingID: building?.id, floorId: floor?.id, @@ -220,8 +221,10 @@ const EditActivityModal = ({ + {errors.plannedWork && (

{errors.plannedWork.message}

)}