Refactor monolithic modules and harden booking, email, and auth infrastructure.
Split oversized frontend API client, email service, and admin/booking pages into focused modules while preserving import surfaces, and add Redis-backed queues, stale booking cleanup, stronger auth, and scale deployment configs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -163,9 +163,8 @@ emailsRouter.put('/templates/:id', requireAuth(['admin']), zValidator('json', up
|
||||
|
||||
const updateData: any = { updatedAt: getNow() };
|
||||
|
||||
// Only allow updating certain fields for system templates
|
||||
const systemProtectedFields = ['slug', 'isSystem'];
|
||||
|
||||
// System templates cannot have their slug or isSystem flag changed; only the
|
||||
// editable fields below are applied.
|
||||
const allowedFields = ['name', 'subject', 'subjectEs', 'bodyHtml', 'bodyHtmlEs', 'bodyText', 'bodyTextEs', 'description', 'variables', 'isActive'];
|
||||
if (!existing.isSystem) {
|
||||
allowedFields.push('slug');
|
||||
@@ -486,7 +485,7 @@ emailsRouter.post('/test', requireAuth(['admin']), async (c) => {
|
||||
|
||||
// Get email queue status
|
||||
emailsRouter.get('/queue/status', requireAuth(['admin']), async (c) => {
|
||||
const status = getQueueStatus();
|
||||
const status = await getQueueStatus();
|
||||
return c.json({ status });
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user