nozzles
This commit is contained in:
@@ -166,6 +166,30 @@ router.get('/flow-rate/:nozzleTypeId/:pressurePsi', validateParams(idParamSchema
|
|||||||
// @access Private
|
// @access Private
|
||||||
router.get('/', async (req, res, next) => {
|
router.get('/', async (req, res, next) => {
|
||||||
try {
|
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(
|
const result = await pool.query(
|
||||||
`SELECT ue.id, ue.custom_name, ue.manufacturer, ue.model,
|
`SELECT ue.id, ue.custom_name, ue.manufacturer, ue.model,
|
||||||
ue.orifice_size, ue.spray_angle, ue.flow_rate_gpm,
|
ue.orifice_size, ue.spray_angle, ue.flow_rate_gpm,
|
||||||
|
|||||||
@@ -238,7 +238,15 @@ const ApplicationPlanModal = ({ onClose, onSubmit }) => {
|
|||||||
setLoadingProperty(true);
|
setLoadingProperty(true);
|
||||||
const response = await propertiesAPI.getById(parseInt(propertyId));
|
const response = await propertiesAPI.getById(parseInt(propertyId));
|
||||||
console.log('Property details response:', response.data);
|
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) {
|
} catch (error) {
|
||||||
console.error('Failed to fetch property details:', error);
|
console.error('Failed to fetch property details:', error);
|
||||||
toast.error('Failed to load property details');
|
toast.error('Failed to load property details');
|
||||||
@@ -342,7 +350,6 @@ const ApplicationPlanModal = ({ onClose, onSubmit }) => {
|
|||||||
{selectedPropertyDetails.latitude && selectedPropertyDetails.longitude && (
|
{selectedPropertyDetails.latitude && selectedPropertyDetails.longitude && (
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
{console.log('Map sections data:', selectedPropertyDetails.sections)}
|
|
||||||
<PropertyMap
|
<PropertyMap
|
||||||
center={[selectedPropertyDetails.latitude, selectedPropertyDetails.longitude]}
|
center={[selectedPropertyDetails.latitude, selectedPropertyDetails.longitude]}
|
||||||
zoom={18}
|
zoom={18}
|
||||||
|
|||||||
Reference in New Issue
Block a user