mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
refactor(api): read the remaining settings and admin route bodies through parseJsonBody
Admin, coach, consent, chart-overlay, device registration, insights feedback and provider chain, ECG ingest, onboarding, search and the AI provider settings move to parseJsonBody with the same message, error code, status and wide-event action they answered with. A refusal whose annotate meta is computed from the issues, or puts its keys in another order than the helper would, keeps that annotate verbatim in onInvalid. The routes that still call safeJson do something between the read and the schema: an optimistic-concurrency token split off the body, a count cap answered first, a refunded quota slot, a conditional read, a non-Zod check, or the body handed to a service.
This commit is contained in:
1 parent
af14d0aa7e
commit
ca04ef01b3
19 files changed
+203
-411
No files matched your search
@@ -1,16 +1,13 @@
|
||||
{
|
||||
"$comment": "safeJson calls per route file under src/app; new body-reading routes use parseJsonBody. Maintained by src/__tests__/route-body-parse-ratchet.test.ts.",
|
||||
"count": 79,
|
||||
"total": 79,
|
||||
"count": 61,
|
||||
"total": 61,
|
||||
"entries": {
|
||||
"app/api/admin/ai-settings/route.ts": 1,
|
||||
"app/api/admin/drain-per-sample-cumulative/route.ts": 1,
|
||||
"app/api/admin/encryption/key-backup/confirm/route.ts": 1,
|
||||
"app/api/admin/encryption/key-backup/verify/route.ts": 1,
|
||||
"app/api/admin/invites/route.ts": 1,
|
||||
"app/api/admin/notifications/reminder-check/route.ts": 1,
|
||||
"app/api/admin/rollups/recompute/route.ts": 1,
|
||||
"app/api/admin/settings/web-push-vapid/generate/route.ts": 1,
|
||||
"app/api/admin/users/[id]/reset-password/route.ts": 1,
|
||||
"app/api/ai/test/route.ts": 1,
|
||||
"app/api/auth/login/route.ts": 1,
|
||||
@@ -23,17 +20,13 @@
|
||||
"app/api/auth/passkey/login-options/route.ts": 1,
|
||||
"app/api/auth/profile/route.ts": 1,
|
||||
"app/api/auth/refresh/route.ts": 1,
|
||||
"app/api/coach/about-me/questions/route.ts": 1,
|
||||
"app/api/coach/about-me/route.ts": 1,
|
||||
"app/api/consent/ai/route.ts": 1,
|
||||
"app/api/cycle/day-logs/bulk/route.ts": 1,
|
||||
"app/api/dashboard/chart-overlay-prefs/route.ts": 1,
|
||||
"app/api/dashboard/widgets/route.ts": 1,
|
||||
"app/api/dawarich/connect/route.ts": 1,
|
||||
"app/api/dawarich/disconnect/route.ts": 1,
|
||||
"app/api/dawarich/settings/route.ts": 1,
|
||||
"app/api/dawarich/sync/route.ts": 1,
|
||||
"app/api/devices/route.ts": 1,
|
||||
"app/api/documents/inbound/[id]/extract/route.ts": 1,
|
||||
"app/api/documents/inbound/[id]/index/route.ts": 1,
|
||||
"app/api/documents/inbound/[id]/suggest/route.ts": 1,
|
||||
@@ -41,12 +34,8 @@
|
||||
"app/api/fitbit/credentials/route.ts": 1,
|
||||
"app/api/google-health/credentials/route.ts": 1,
|
||||
"app/api/import/route.ts": 1,
|
||||
"app/api/insights/chat/messages/[id]/feedback/route.ts": 1,
|
||||
"app/api/insights/ecg/route.ts": 1,
|
||||
"app/api/insights/feedback/route.ts": 1,
|
||||
"app/api/insights/generate/route.ts": 1,
|
||||
"app/api/insights/layout/route.ts": 1,
|
||||
"app/api/insights/provider-chain/route.ts": 1,
|
||||
"app/api/integrations/healthkit/route.ts": 1,
|
||||
"app/api/internal/deploy-webhook/route.ts": 1,
|
||||
"app/api/labs/ocr/extract/route.ts": 1,
|
||||
@@ -63,21 +52,14 @@
|
||||
"app/api/mood/tags/layout/route.ts": 1,
|
||||
"app/api/nightscout/connect/route.ts": 1,
|
||||
"app/api/nutrients/batch/route.ts": 1,
|
||||
"app/api/onboarding/answers/route.ts": 1,
|
||||
"app/api/onboarding/complete/route.ts": 1,
|
||||
"app/api/onboarding/disclaimer/route.ts": 1,
|
||||
"app/api/onboarding/restart/route.ts": 1,
|
||||
"app/api/onboarding/tour/route.ts": 1,
|
||||
"app/api/oura/credentials/route.ts": 1,
|
||||
"app/api/polar/credentials/route.ts": 1,
|
||||
"app/api/record-settings/[family]/route.ts": 1,
|
||||
"app/api/search/route.ts": 1,
|
||||
"app/api/settings/email/route.ts": 1,
|
||||
"app/api/settings/ntfy/route.ts": 1,
|
||||
"app/api/settings/telegram/route.ts": 1,
|
||||
"app/api/settings/webhook/route.ts": 1,
|
||||
"app/api/strava/credentials/route.ts": 1,
|
||||
"app/api/user/ai-provider/route.ts": 1,
|
||||
"app/api/user/profile/route.ts": 1,
|
||||
"app/api/whoop/credentials/route.ts": 1,
|
||||
"app/api/withings/credentials/route.ts": 1,
|
||||
|
||||
Reference in new issue
Block a user