From e5ef98043f0828c5ae14029303372fe7b0ba00a7 Mon Sep 17 00:00:00 2001 From: Jake Kasper Date: Wed, 27 Aug 2025 10:14:42 -0400 Subject: [PATCH] asdf --- .../src/pages/Applications/Applications.js | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/Applications/Applications.js b/frontend/src/pages/Applications/Applications.js index 361f039..ce9cb08 100644 --- a/frontend/src/pages/Applications/Applications.js +++ b/frontend/src/pages/Applications/Applications.js @@ -85,6 +85,14 @@ const Applications = () => { }; const fetchPropertyDetails = async (propertyId) => { + // Validate propertyId + if (!propertyId || isNaN(parseInt(propertyId))) { + console.error('Invalid property ID:', propertyId); + toast.error('Invalid property ID'); + setSelectedPropertyDetails(null); + return null; + } + // Check cache first if (propertyCache[propertyId]) { setSelectedPropertyDetails(propertyCache[propertyId]); @@ -140,9 +148,17 @@ const Applications = () => { // Set the executing application and show the modal setExecutingApplication(application); - // Also fetch the property details if we don't have them - if (!selectedPropertyDetails || selectedPropertyDetails.id !== application.property?.id) { - await fetchPropertyDetails(application.property?.id || application.section?.propertyId); + // Get the property ID from the application + const propertyId = application.property?.id || application.section?.propertyId; + + // Also fetch the property details if we don't have them and we have a valid property ID + if (!selectedPropertyDetails || (propertyId && selectedPropertyDetails.id !== propertyId)) { + if (propertyId) { + await fetchPropertyDetails(propertyId); + } else { + console.warn('No property ID found for application:', application); + toast.warning('No property associated with this application'); + } } setShowExecutionModal(true);