diff --git a/src/app/api/logs/route.ts b/src/app/api/logs/route.ts index ea81d5d..fb9ec6a 100644 --- a/src/app/api/logs/route.ts +++ b/src/app/api/logs/route.ts @@ -23,9 +23,10 @@ export async function POST(request: Request) { const now = new Date().toISOString(); if (type === "feed") { + const method = subType.includes("breast") ? "breast_both" : "bottle"; await sql.unsafe( `INSERT INTO feeds (child_id, type, method, amount_ml, notes, logged_at) VALUES ($1, $2, $3, $4, $5, $6)`, - [childId, subType, subType.includes("breast") ? subType : "bottle", amountMl || null, notes || null, now] + [childId, subType, method, amountMl || null, notes || null, now] ); } else if (type === "diaper") { await sql.unsafe(