fix: eliminate double VIES call on Verify click

Let the verifiedVatId useEffect handle the fetch instead of
calling fetchVAT directly in handleVerifyVatId. Prevents
VIES MS_MAX_CONCURRENT_REQ rate limiting.
This commit is contained in:
Usman Baig
2026-03-27 12:37:08 +01:00
parent 8db8f65fca
commit 9656225b60

View File

@@ -75,7 +75,7 @@ export default function PlanSummary({ plan, interval, limit, country, vatId, onC
const handleVerifyVatId = () => {
if (!vatId || !country) return
setVerifiedVatId(vatId)
fetchVAT(country, vatId, currentInterval)
// useEffect on verifiedVatId will trigger the fetch
}
const isVatChecked = verifiedVatId !== '' && verifiedVatId === vatId