diff --git a/src/app/api/insights/biomarker-assessment/route.ts b/src/app/api/insights/biomarker-assessment/route.ts index 4297cfd26..e17b59c48 100644 --- a/src/app/api/insights/biomarker-assessment/route.ts +++ b/src/app/api/insights/biomarker-assessment/route.ts @@ -28,7 +28,7 @@ import { resolveServerLocale } from "@/lib/i18n/server-locale"; import { aiCapabilityToServe } from "@/lib/ai/capabilities/gate"; import { unavailableStatusBody } from "@/lib/insights/status-unavailable"; import { generateBiomarkerStatus } from "@/lib/insights/biomarker-status"; -import { normalizeLocale as resolveMetricStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; export const dynamic = "force-dynamic"; @@ -67,7 +67,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveMetricStatusLocale(resolved); + const locale = normalizeLocale(resolved); const result = await generateBiomarkerStatus({ biomarkerId: parsed.data.biomarkerId, diff --git a/src/app/api/insights/blood-pressure-status/route.ts b/src/app/api/insights/blood-pressure-status/route.ts index 2671d62fd..36d498d07 100644 --- a/src/app/api/insights/blood-pressure-status/route.ts +++ b/src/app/api/insights/blood-pressure-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generateBloodPressureStatusForUser } from "@/lib/insights/blood-pressure-status"; -import { normalizeLocale as resolveBloodPressureStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -40,7 +40,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveBloodPressureStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/ diff --git a/src/app/api/insights/bmi-status/route.ts b/src/app/api/insights/bmi-status/route.ts index afd28f1cf..3f42a2667 100644 --- a/src/app/api/insights/bmi-status/route.ts +++ b/src/app/api/insights/bmi-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generateBmiStatusForUser } from "@/lib/insights/bmi-status"; -import { normalizeLocale as resolveBmiStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -40,7 +40,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveBmiStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/ diff --git a/src/app/api/insights/medication-compliance-status/route.ts b/src/app/api/insights/medication-compliance-status/route.ts index 2be9b3368..1e13ff12d 100644 --- a/src/app/api/insights/medication-compliance-status/route.ts +++ b/src/app/api/insights/medication-compliance-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generateMedicationComplianceStatusForUser } from "@/lib/insights/medication-compliance-status"; -import { normalizeLocale as resolveMedicationComplianceStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -40,7 +40,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveMedicationComplianceStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/ diff --git a/src/app/api/insights/metric-status/route.ts b/src/app/api/insights/metric-status/route.ts index 21640e778..5f490dac5 100644 --- a/src/app/api/insights/metric-status/route.ts +++ b/src/app/api/insights/metric-status/route.ts @@ -34,7 +34,7 @@ import { aiCapabilityToServe } from "@/lib/ai/capabilities/gate"; import { unavailableStatusBody } from "@/lib/insights/status-unavailable"; import { prisma } from "@/lib/db"; import { generateMetricStatus } from "@/lib/insights/metric-status"; -import { normalizeLocale as resolveMetricStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { METRIC_STATUS_IDS, getMetricStatusMeta, @@ -132,7 +132,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveMetricStatusLocale(resolved); + const locale = normalizeLocale(resolved); const result = await generateMetricStatus({ metric, diff --git a/src/app/api/insights/mood-status/route.ts b/src/app/api/insights/mood-status/route.ts index 41fa7f304..565b885c6 100644 --- a/src/app/api/insights/mood-status/route.ts +++ b/src/app/api/insights/mood-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generateMoodStatusForUser } from "@/lib/insights/mood-status"; -import { normalizeLocale as resolveMoodStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -47,7 +47,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveMoodStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/ diff --git a/src/app/api/insights/pulse-status/route.ts b/src/app/api/insights/pulse-status/route.ts index 76b5a0f2c..4811fe1f4 100644 --- a/src/app/api/insights/pulse-status/route.ts +++ b/src/app/api/insights/pulse-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generatePulseStatusForUser } from "@/lib/insights/pulse-status"; -import { normalizeLocale as resolvePulseStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -40,7 +40,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolvePulseStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/ diff --git a/src/app/api/insights/weight-status/route.ts b/src/app/api/insights/weight-status/route.ts index 65a185874..43e916d4c 100644 --- a/src/app/api/insights/weight-status/route.ts +++ b/src/app/api/insights/weight-status/route.ts @@ -1,7 +1,7 @@ import { NextRequest } from "next/server"; import { apiSuccess } from "@/lib/api-response"; import { generateWeightStatusForUser } from "@/lib/insights/weight-status"; -import { normalizeLocale as resolveWeightStatusLocale } from "@/lib/insights/status-shared"; +import { normalizeLocale } from "@/lib/insights/status-shared"; import { apiHandler, requireRecordAuth } from "@/lib/api-handler"; import { annotate } from "@/lib/logging/context"; import { resolveServerLocale } from "@/lib/i18n/server-locale"; @@ -40,7 +40,7 @@ export const GET = apiHandler(async (request: NextRequest) => { userLocale: user.locale ?? null, override: localeParam, }); - const locale = resolveWeightStatusLocale(resolved); + const locale = normalizeLocale(resolved); // v1.8.3 — read-only: serve the cache, enqueue generation out of band on // a miss. The GET never awaits the provider, so opening /insights/