app debugging

This commit is contained in:
Jake Kasper
2025-08-23 13:28:33 -04:00
parent f480fddc2c
commit 83f2a3339c

View File

@@ -219,6 +219,15 @@ router.post('/plans', validateRequest(applicationPlanSchema), async (req, res, n
const equipment = equipmentCheck.rows[0];
console.log('Creating plan with data:', {
userId: req.user.id,
lawnSectionId,
equipmentId,
nozzleId,
plannedDate,
notes
});
// Create application plan
const planResult = await client.query(
`INSERT INTO application_plans (user_id, lawn_section_id, equipment_id, nozzle_id, planned_date, notes)
@@ -287,12 +296,14 @@ router.post('/plans', validateRequest(applicationPlanSchema), async (req, res, n
}
});
} catch (error) {
console.error('Plan creation transaction error:', error);
await client.query('ROLLBACK');
throw error;
} finally {
client.release();
}
} catch (error) {
console.error('Plan creation error:', error);
next(error);
}
});