mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-07 04:12:04 +00:00
HealthLog — personal health-tracking PWA with weight, blood pressure, pulse, mood tracking, medication compliance, Withings integration, doctor report PDF export, and Dracula-themed UI.
29 lines
789 B
TypeScript
29 lines
789 B
TypeScript
import { NextRequest } from "next/server";
|
|
import { apiSuccess } from "@/lib/api-response";
|
|
import {
|
|
generateBmiStatusForUser,
|
|
resolveBmiStatusLocale,
|
|
} from "@/lib/insights/bmi-status";
|
|
import { apiHandler, requireAuth } from "@/lib/api-handler";
|
|
import { annotate } from "@/lib/logging/context";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export const GET = apiHandler(async (request: NextRequest) => {
|
|
const { user } = await requireAuth();
|
|
|
|
const localeParam = request.nextUrl.searchParams.get("locale");
|
|
const locale = resolveBmiStatusLocale(
|
|
localeParam ?? user.locale ?? "de",
|
|
);
|
|
|
|
const result = await generateBmiStatusForUser(user.id, {
|
|
locale,
|
|
force: false,
|
|
});
|
|
|
|
annotate({ action: { name: "insights.bmi-status" } });
|
|
|
|
return apiSuccess(result);
|
|
});
|