From fd3e700c2a0b52a10882067d3493fef27a90023b Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 23 Apr 2025 09:37:00 -0700 Subject: [PATCH] Fix form not reset Signed-off-by: Bryan Frimin --- .../organizations/vendors/VendorView.tsx | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/apps/console/src/pages/organizations/vendors/VendorView.tsx b/apps/console/src/pages/organizations/vendors/VendorView.tsx index 3524ec6d9..1d25648ab 100644 --- a/apps/console/src/pages/organizations/vendors/VendorView.tsx +++ b/apps/console/src/pages/organizations/vendors/VendorView.tsx @@ -883,16 +883,19 @@ function RiskAssessmentModal({ const [dataSensitivity, setDataSensitivity] = useState("LOW"); const [businessImpact, setBusinessImpact] = useState("LOW"); const [notes, setNotes] = useState(""); - const [showError, setShowError] = useState(false); + + // Reset form when modal opens + useEffect(() => { + if (isOpen) { + setDataSensitivity("LOW"); + setBusinessImpact("LOW"); + setNotes(""); + } + }, [isOpen]); if (!isOpen) return null; const handleSubmit = () => { - if (!businessOwnerId) { - setShowError(true); - return; - } - onSubmit({ dataSensitivity, businessImpact, @@ -922,13 +925,6 @@ function RiskAssessmentModal({

Create Risk Assessment

- {showError && !businessOwnerId && ( -
-

Business Owner Required

-

Please assign a Business Owner to this vendor before creating a risk assessment.

-
- )} -