feat: implement flexible feeding intervals and fix layout alignment

This commit is contained in:
2026-01-12 23:06:12 +01:00
parent 87f4e43c9f
commit 3600ba665d
8 changed files with 149 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ import prisma from '@/lib/prisma';
export async function POST(req: Request) {
try {
const body = await req.json();
const { title, startDate, endDate, password, instructions } = body;
const { title, startDate, endDate, password, instructions, feedingPerDay, feedingInterval, litterInterval } = body;
if (!title || !startDate || !endDate || !password) {
return NextResponse.json({ error: 'Missing required fields' }, { status: 400 });
@@ -17,6 +17,9 @@ export async function POST(req: Request) {
endDate: new Date(endDate),
password,
instructions,
feedingPerDay: feedingPerDay ? parseInt(feedingPerDay) : undefined,
feedingInterval: feedingInterval ? parseInt(feedingInterval) : undefined,
litterInterval: litterInterval ? parseInt(litterInterval) : undefined,
},
});