mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 21:32:18 +00:00
chore(style): repo-wide prettier sweep before v1.4.6 tag
Long-overdue prettier sweep; prettier had drifted vs. checked-in code across ~130 files (mostly long-argument line-break wrapping in TS and table-padding in markdown). Pure formatting — no semantic changes — and required to clear the v1.4.6 release gate's `pnpm format:check`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
67575180b8
commit
02b99553b9
135 files changed
+2159
-1583
No files matched your search
@@ -46,7 +46,8 @@ export const PATCH = apiHandler(async (request: NextRequest) => {
|
||||
const { user } = await requireAuth();
|
||||
annotate({ action: { name: "user.ai-provider.update" } });
|
||||
|
||||
const { data: body, error } = await safeJson<Record<string, unknown>>(request);
|
||||
const { data: body, error } =
|
||||
await safeJson<Record<string, unknown>>(request);
|
||||
if (error) return error;
|
||||
|
||||
const updates: Record<string, unknown> = {};
|
||||
@@ -54,7 +55,10 @@ export const PATCH = apiHandler(async (request: NextRequest) => {
|
||||
if (body.provider !== undefined) {
|
||||
if (body.provider === null || body.provider === "") {
|
||||
updates.aiProvider = null;
|
||||
} else if (typeof body.provider === "string" && ALLOWED.has(body.provider)) {
|
||||
} else if (
|
||||
typeof body.provider === "string" &&
|
||||
ALLOWED.has(body.provider)
|
||||
) {
|
||||
updates.aiProvider = body.provider;
|
||||
} else {
|
||||
throw new HttpError(422, "Invalid provider");
|
||||
|
||||
@@ -21,7 +21,11 @@ vi.mock("@/lib/db-compat", () => ({
|
||||
|
||||
vi.mock("next/headers", () => ({
|
||||
headers: vi.fn(async () => ({ get: () => null })),
|
||||
cookies: vi.fn(async () => ({ get: () => undefined, set: () => {}, delete: () => {} })),
|
||||
cookies: vi.fn(async () => ({
|
||||
get: () => undefined,
|
||||
set: () => {},
|
||||
delete: () => {},
|
||||
})),
|
||||
}));
|
||||
|
||||
import { GET, PATCH } from "../route";
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
*/
|
||||
import { NextRequest } from "next/server";
|
||||
import { apiHandler, requireAuth } from "@/lib/api-handler";
|
||||
import { apiError, apiSuccess, getClientIp, safeJson } from "@/lib/api-response";
|
||||
import {
|
||||
apiError,
|
||||
apiSuccess,
|
||||
getClientIp,
|
||||
safeJson,
|
||||
} from "@/lib/api-response";
|
||||
import { annotate } from "@/lib/logging/context";
|
||||
import { applyProfileUpdate } from "@/lib/auth/profile-update";
|
||||
import { prisma } from "@/lib/db";
|
||||
|
||||
@@ -8,7 +8,12 @@
|
||||
* DELETE with ?metric=... resets one metric to default.
|
||||
*/
|
||||
import { apiHandler, requireAuth } from "@/lib/api-handler";
|
||||
import { apiSuccess, apiError, safeJson, getClientIp } from "@/lib/api-response";
|
||||
import {
|
||||
apiSuccess,
|
||||
apiError,
|
||||
safeJson,
|
||||
getClientIp,
|
||||
} from "@/lib/api-response";
|
||||
import { annotate } from "@/lib/logging/context";
|
||||
import { prisma } from "@/lib/db";
|
||||
import { auditLog } from "@/lib/auth/audit";
|
||||
@@ -36,9 +41,8 @@ async function loadProfileAndOverrides(userId: string) {
|
||||
},
|
||||
});
|
||||
if (!profile) return null;
|
||||
const overrides = (profile.thresholdsJson ?? null) as
|
||||
| ThresholdOverridesJson
|
||||
| null;
|
||||
const overrides = (profile.thresholdsJson ??
|
||||
null) as ThresholdOverridesJson | null;
|
||||
return { profile, overrides };
|
||||
}
|
||||
|
||||
@@ -130,8 +134,7 @@ export const DELETE = apiHandler(async (request: NextRequest) => {
|
||||
await prisma.user.update({
|
||||
where: { id: user.id },
|
||||
data: {
|
||||
thresholdsJson:
|
||||
Object.keys(after).length === 0 ? Prisma.JsonNull : after,
|
||||
thresholdsJson: Object.keys(after).length === 0 ? Prisma.JsonNull : after,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user