From ee73363fc25a69c490cdb43ae1773b59e23d6616 Mon Sep 17 00:00:00 2001 From: Ethan Niser Date: Fri, 18 Oct 2024 16:01:03 -0400 Subject: [PATCH] properly ppr /order --- src/app/order/page.tsx | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/app/order/page.tsx b/src/app/order/page.tsx index 4a63f7e..6b1e4d9 100644 --- a/src/app/order/page.tsx +++ b/src/app/order/page.tsx @@ -1,13 +1,4 @@ import { LoginForm } from "@/components/login-form"; -import { getCart } from "@/lib/cart"; -import { X } from "lucide-react"; -import type { CartItem } from "@/lib/cart"; -import Image from "next/image"; -import { db } from "@/db"; -import { removeFromCart } from "@/lib/actions"; -import { products } from "@/db/schema"; -import { inArray } from "drizzle-orm"; -import Link from "next/link"; import { Metadata } from "next"; import { Suspense } from "react"; import { CartItems, TotalCost } from "./dynamic"; @@ -17,25 +8,6 @@ export const metadata: Metadata = { }; export default async function Page() { - const cart = await getCart(); - const dbProducts = await db - .select() - .from(products) - .where( - inArray( - products.slug, - cart.map((item) => item.productSlug), - ), - ); - - const totalCost = cart.reduce( - (acc, item) => - acc + - item.quantity * - (Number(dbProducts.find((p) => p.slug === item.productSlug)?.price) ?? - 0), - 0, - ); return (