From a1fa84dcdf92d6ba42bafa73444bde4b020e29ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 1 Oct 2026 09:53:45 +0200 Subject: [PATCH] chore(units): drop the preference loader nothing calls yet --- src/lib/measurements/unit-preferences.ts | 26 ------------------------ 1 file changed, 26 deletions(-) delete mode 100644 src/lib/measurements/unit-preferences.ts diff --git a/src/lib/measurements/unit-preferences.ts b/src/lib/measurements/unit-preferences.ts deleted file mode 100644 index 5dadc9b7b..000000000 --- a/src/lib/measurements/unit-preferences.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Server-side read of a record's two unit preferences. - * - * Every text the server writes for a person to read — a status note, a period - * narrative, a score label — quotes numbers, and a number is only right in the - * unit its reader chose. This is the one read those producers share, so none - * of them can load `unitPreference` and forget `glucoseUnit` or the reverse. - */ -import { prisma } from "@/lib/db"; - -import { - DEFAULT_UNIT_PREFERENCES, - resolveUnitPreferences, - type UnitPreferences, -} from "./display-transform"; - -/** Both preferences of one record; the defaults when the row is gone. */ -export async function loadUnitPreferences( - userId: string, -): Promise { - const row = await prisma.user.findUnique({ - where: { id: userId }, - select: { unitPreference: true, glucoseUnit: true }, - }); - return row ? resolveUnitPreferences(row) : DEFAULT_UNIT_PREFERENCES; -}