From a0e727685b9572060eb896482706524f67e55c3a Mon Sep 17 00:00:00 2001 From: david emioma Date: Tue, 2 Apr 2024 15:04:36 +0100 Subject: [PATCH] Deployment issue #3 --- app/api/cart/route.ts | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/api/cart/route.ts b/app/api/cart/route.ts index 4f0f69a..11d9698 100644 --- a/app/api/cart/route.ts +++ b/app/api/cart/route.ts @@ -1,7 +1,6 @@ import prismadb from "@/lib/prisma"; import { UserRole } from "@prisma/client"; import { NextResponse } from "next/server"; -import { apiRatelimit } from "@/lib/redis"; import { currentRole, currentUser } from "@/lib/auth"; import { CartItemSchema } from "@/lib/validators/cart-item"; @@ -27,22 +26,6 @@ export async function POST(request: Request) { ); } - try { - const { success } = await apiRatelimit?.limit(user.id ?? ""); - - if (!success && process.env.VERCEL_ENV === "production") { - return new NextResponse("Too Many Requests! try again in 1 min", { - status: 429, - }); - } - } catch (err) { - console.error("Rate Limiting Error:", err); - - return new NextResponse("An error occurred. Please try again later.", { - status: 503, - }); - } - const body = await request.json(); let validatedBody;