Fix feed method enum value
This commit is contained in:
parent
afb1555389
commit
eddb1dd8ea
1 changed files with 2 additions and 1 deletions
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue