From 158dbbf166f2fc692bf259993eaa89a9205f1fa6 Mon Sep 17 00:00:00 2001 From: Tim Howitz Date: Tue, 13 May 2025 23:05:14 +0100 Subject: [PATCH] Removed comment --- src/app/api/earthquakes/route.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/app/api/earthquakes/route.ts b/src/app/api/earthquakes/route.ts index addbd60..4c2529e 100644 --- a/src/app/api/earthquakes/route.ts +++ b/src/app/api/earthquakes/route.ts @@ -8,21 +8,21 @@ if (usingPrisma) prisma = new PrismaClient(); export async function POST(req: Request) { try { - const json = await req.json(); // Parse incoming JSON data - const {rangeDaysPrev} = json.body + const json = await req.json(); + const { rangeDaysPrev } = json.body; - const now = new Date() - const rangeBeginning = new Date(); - rangeBeginning.setDate(rangeBeginning.getDate() - rangeDaysPrev) + const now = new Date(); + const rangeBeginning = new Date(); + rangeBeginning.setDate(rangeBeginning.getDate() - rangeDaysPrev); - const earthquakes = await prisma.earthquake.findMany( - {where: { - date: { - gte: rangeBeginning, - lte: now - } - }} - ); + const earthquakes = await prisma.earthquake.findMany({ + where: { + date: { + gte: rangeBeginning, + lte: now, + }, + }, + }); if (earthquakes) { return NextResponse.json({ message: "Got earthquakes successfully", earthquakes }, { status: 200 });