Skip to content

Commit

Permalink
Deployment issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
david emioma committed Apr 2, 2024
1 parent 5df081b commit a0e7276
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions app/api/cart/route.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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;
Expand Down

0 comments on commit a0e7276

Please sign in to comment.