asdfasdf
This commit is contained in:
@@ -312,7 +312,8 @@ router.delete('/:id', validateParams(idParamSchema), async (req, res, next) => {
|
||||
const activeApps = await pool.query(
|
||||
`SELECT COUNT(*) as count
|
||||
FROM application_plans ap
|
||||
JOIN lawn_sections ls ON ap.lawn_section_id = ls.id
|
||||
JOIN application_plan_sections aps ON ap.id = aps.plan_id
|
||||
JOIN lawn_sections ls ON aps.lawn_section_id = ls.id
|
||||
WHERE ls.property_id = $1 AND ap.status IN ('planned', 'in_progress')`,
|
||||
[propertyId]
|
||||
);
|
||||
@@ -507,8 +508,9 @@ router.delete('/:propertyId/sections/:sectionId', async (req, res, next) => {
|
||||
// Check for active applications
|
||||
const activeApps = await pool.query(
|
||||
`SELECT COUNT(*) as count
|
||||
FROM application_plans
|
||||
WHERE lawn_section_id = $1 AND status IN ('planned', 'in_progress')`,
|
||||
FROM application_plans ap
|
||||
JOIN application_plan_sections aps ON ap.id = aps.plan_id
|
||||
WHERE aps.lawn_section_id = $1 AND ap.status IN ('planned', 'in_progress')`,
|
||||
[sectionId]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user