mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
style(glp1): prettier formatting across W4d surfaces
This commit is contained in:
1 parent
a68dbdc22c
commit
d74aa2066b
15 files changed
+1035
-73
No files matched your search
@@ -136,13 +136,18 @@ export const POST = apiHandler(
|
||||
return apiError("Medication not found", 404);
|
||||
}
|
||||
|
||||
const body = (await request.json().catch(() => null)) as Glp1PostBody | null;
|
||||
const body = (await request
|
||||
.json()
|
||||
.catch(() => null)) as Glp1PostBody | null;
|
||||
if (!body) return apiError("Invalid body", 400);
|
||||
|
||||
if (body.doseChange) {
|
||||
const { effectiveFrom, doseValue, doseUnit, note } = body.doseChange;
|
||||
if (!effectiveFrom || typeof doseValue !== "number" || !doseUnit) {
|
||||
return apiError("doseChange.effectiveFrom + doseValue + doseUnit required", 422);
|
||||
return apiError(
|
||||
"doseChange.effectiveFrom + doseValue + doseUnit required",
|
||||
422,
|
||||
);
|
||||
}
|
||||
const created = await prisma.medicationDoseChange.create({
|
||||
data: {
|
||||
|
||||
Reference in new issue
Block a user