From 83f2a3339c556fadc0d43927502c5c5bb010c884 Mon Sep 17 00:00:00 2001 From: Jake Kasper Date: Sat, 23 Aug 2025 13:28:33 -0400 Subject: [PATCH] app debugging --- backend/src/routes/applications.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/src/routes/applications.js b/backend/src/routes/applications.js index 2a72745..b328bf7 100644 --- a/backend/src/routes/applications.js +++ b/backend/src/routes/applications.js @@ -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); } });