feat: implement flexible feeding intervals and fix layout alignment
This commit is contained in:
@@ -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,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user