From c1735f4be5da4a307085b59995ec1e52a075c748 Mon Sep 17 00:00:00 2001 From: kaustubh bhagwat Date: Mon, 24 Nov 2025 20:29:31 +0530 Subject: [PATCH] IRS-184: Stop calling the fees api if the fees field and membership id is not present to avoid multiple calls --- js/webform_civicrm_forms.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/webform_civicrm_forms.js b/js/webform_civicrm_forms.js index 7a13537a9..55cac32fb 100644 --- a/js/webform_civicrm_forms.js +++ b/js/webform_civicrm_forms.js @@ -452,10 +452,12 @@ var wfCivi = (function ($, D) { // Function to update fee field with AJAX call. function updateFeeField(membershipId, feeFieldInput) { - if (!membershipId || feeFieldInput.length === 0) { - return; + if (!membershipId) { + throw new Error("Membership Id not found."); + } + if ($(feeFieldInput).length === 0) { + throw new Error("Membership-fee-amount-from-membership not found."); } - $.ajax({ url: '/webform-civicrm/js/getMembershipFees/' + membershipId, dataType: 'json',