Fix feed method enum value

This commit is contained in:
Manohar Gupta 2026-05-10 05:32:35 +05:30
parent afb1555389
commit eddb1dd8ea

View file

@ -23,9 +23,10 @@ export async function POST(request: Request) {
const now = new Date().toISOString(); const now = new Date().toISOString();
if (type === "feed") { if (type === "feed") {
const method = subType.includes("breast") ? "breast_both" : "bottle";
await sql.unsafe( await sql.unsafe(
`INSERT INTO feeds (child_id, type, method, amount_ml, notes, logged_at) VALUES ($1, $2, $3, $4, $5, $6)`, `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") { } else if (type === "diaper") {
await sql.unsafe( await sql.unsafe(