fix: resolve JS-005, JS-006, SVC-006 architecture violations

- JS-005: Add initialization guards to email-templates.js (admin/vendor)
- JS-006: Add try/catch error handling to content-pages.js init
- SVC-006: Move db.commit() from services to endpoints for proper
  transaction control in email_template_service and vendor_team_service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-03 20:00:10 +01:00
parent 87056ea65c
commit 6df7167f80
8 changed files with 75 additions and 15 deletions

View File

@@ -220,7 +220,6 @@ class EmailTemplateService:
template.body_html = body_html
template.body_text = body_text
self.db.commit()
logger.info(f"Updated platform template: {code}/{language}")
def preview_template(
@@ -575,8 +574,6 @@ class EmailTemplateService:
name=name,
)
self.db.commit()
logger.info(f"Vendor {vendor_id} updated template override: {code}/{language}")
return {
@@ -614,7 +611,6 @@ class EmailTemplateService:
if not deleted:
raise ResourceNotFoundException("No override found for this template and language")
self.db.commit()
logger.info(f"Vendor {vendor_id} deleted template override: {code}/{language}")
def preview_vendor_template(