mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
Every endpoint that mutates a measurement / mood / medication / intake / workout / dashboard-widget row now calls the matching invalidateUser* helper after its database commit so the next cached read paints fresh data instead of waiting out the TTL. The admin app-settings PUT also flushes the bug-report-status singleton cache. Endpoints wired (per blueprint §6 matrix): POST/DELETE /api/measurements PUT/DELETE /api/measurements/[id] POST /api/measurements/batch DELETE /api/measurements/by-external-ids POST/PUT/DELETE /api/mood-entries[/id] POST /api/mood-entries/bulk POST/PUT/DELETE /api/medications[/id] POST /api/medications/[id]/intake PUT/DELETE /api/medications/[id]/intake/[eventId] POST /api/medications/intake/bulk POST /api/workouts/batch PUT/DELETE /api/dashboard/widgets PUT /api/admin/settings (bug-report toggle path) Batch endpoints gate invalidation on insertedCount > 0 so a duplicates-only ingest stays a no-op. Route-level tests reset every cache in beforeEach so re-using a fixed userId doesn't carry response state across cases.