diff --git a/backend/src/routes/nozzles.js b/backend/src/routes/nozzles.js index 1ffd436..6bb20cc 100644 --- a/backend/src/routes/nozzles.js +++ b/backend/src/routes/nozzles.js @@ -166,6 +166,30 @@ router.get('/flow-rate/:nozzleTypeId/:pressurePsi', validateParams(idParamSchema // @access Private router.get('/', async (req, res, next) => { try { + // Debug: Check what equipment categories exist + const categoriesResult = await pool.query( + `SELECT DISTINCT ec.name as category_name, COUNT(*) as count + FROM user_equipment ue + JOIN equipment_types et ON ue.equipment_type_id = et.id + JOIN equipment_categories ec ON et.category_id = ec.id + WHERE ue.user_id = $1 + GROUP BY ec.name`, + [req.user.id] + ); + console.log('User equipment categories:', categoriesResult.rows); + + // Debug: Check all equipment with nozzle-related fields + const nozzleFieldsResult = await pool.query( + `SELECT ue.id, ue.custom_name, ec.name as category_name, et.name as type_name, + ue.orifice_size, ue.spray_angle, ue.flow_rate_gpm + FROM user_equipment ue + JOIN equipment_types et ON ue.equipment_type_id = et.id + JOIN equipment_categories ec ON et.category_id = ec.id + WHERE ue.user_id = $1 AND (ue.orifice_size IS NOT NULL OR ec.name ILIKE '%nozzle%')`, + [req.user.id] + ); + console.log('Equipment with nozzle fields:', nozzleFieldsResult.rows); + const result = await pool.query( `SELECT ue.id, ue.custom_name, ue.manufacturer, ue.model, ue.orifice_size, ue.spray_angle, ue.flow_rate_gpm, diff --git a/frontend/src/pages/Applications/Applications.js b/frontend/src/pages/Applications/Applications.js index bc1f42b..6219245 100644 --- a/frontend/src/pages/Applications/Applications.js +++ b/frontend/src/pages/Applications/Applications.js @@ -238,7 +238,15 @@ const ApplicationPlanModal = ({ onClose, onSubmit }) => { setLoadingProperty(true); const response = await propertiesAPI.getById(parseInt(propertyId)); console.log('Property details response:', response.data); - setSelectedPropertyDetails(response.data.data.property); + const property = response.data.data.property; + console.log('Property sections with polygon data:', property.sections?.map(s => ({ + id: s.id, + name: s.name, + hasPolygonData: !!s.polygonData, + polygonDataType: typeof s.polygonData, + coordinates: s.polygonData?.coordinates?.[0]?.length || 0 + }))); + setSelectedPropertyDetails(property); } catch (error) { console.error('Failed to fetch property details:', error); toast.error('Failed to load property details'); @@ -342,7 +350,6 @@ const ApplicationPlanModal = ({ onClose, onSubmit }) => { {selectedPropertyDetails.latitude && selectedPropertyDetails.longitude && (
- {console.log('Map sections data:', selectedPropertyDetails.sections)}