From aac4af90ae9a200b3f968c7daf9310fd9eded869 Mon Sep 17 00:00:00 2001 From: paolosantarsiero Date: Tue, 31 Dec 2024 11:37:43 +0100 Subject: [PATCH] fix: build --- app/[...not_found]/page.tsx | 5 + app/api/auth/[...nextauth]/route.ts | 4 +- app/api/cart/route.ts | 15 +- app/api/customer/route.ts | 6 +- app/checkout/page.tsx | 2 +- app/login/page.tsx | 6 +- app/product/[name]/page.tsx | 4 +- app/search/layout.tsx | 3 +- app/search/page.tsx | 6 +- app/signup/page.tsx | 44 +- components/button/logout.tsx | 2 +- components/cart/add-to-cart.tsx | 27 +- components/cart/cart-context.tsx | 2 +- components/layout/footer-menu.tsx | 1 - components/layout/footer.tsx | 8 +- components/layout/search/filter/index.tsx | 18 +- components/next-session-provider.tsx | 1 - components/product/product-context.tsx | 4 +- components/product/product-description.tsx | 19 +- components/product/variant-selector.tsx | 28 +- lib/auth/config.ts | 4 +- lib/woocomerce/models/client.ts | 4 +- lib/woocomerce/storeApi.ts | 8 +- lib/woocomerce/woocommerce.ts | 6 +- pnpm-lock.yaml | 2291 +++++++++++++++----- 25 files changed, 1891 insertions(+), 627 deletions(-) create mode 100644 app/[...not_found]/page.tsx diff --git a/app/[...not_found]/page.tsx b/app/[...not_found]/page.tsx new file mode 100644 index 000000000..2cfe638a6 --- /dev/null +++ b/app/[...not_found]/page.tsx @@ -0,0 +1,5 @@ +import { notFound } from 'next/navigation'; + +export default function NotFoundCatchAll() { + notFound(); +} diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/auth/[...nextauth]/route.ts index 23ec62ad8..06649427a 100644 --- a/app/api/auth/[...nextauth]/route.ts +++ b/app/api/auth/[...nextauth]/route.ts @@ -1,5 +1,5 @@ -import { authOptions } from "lib/auth/config"; -import NextAuth from "next-auth"; +import { authOptions } from 'lib/auth/config'; +import NextAuth from 'next-auth'; const handler = NextAuth(authOptions); export { handler as GET, handler as POST }; diff --git a/app/api/cart/route.ts b/app/api/cart/route.ts index 78c6aa26e..a7f34a724 100644 --- a/app/api/cart/route.ts +++ b/app/api/cart/route.ts @@ -20,7 +20,10 @@ export async function POST(req: NextRequest) { const cart = await storeApi.addToCart({ id, quantity, variation }); return NextResponse.json(cart, { status: 200 }); } catch (error) { - return NextResponse.json({ error: 'Failed to add item to cart', message: JSON.stringify(error) }, { status: 500 }); + return NextResponse.json( + { error: 'Failed to add item to cart', message: JSON.stringify(error) }, + { status: 500 } + ); } } @@ -35,7 +38,10 @@ export async function PUT(req: NextRequest) { return NextResponse.json(cart, { status: 200 }); } } catch (error) { - return NextResponse.json({ error: 'Failed to update cart item', message: JSON.stringify(error) }, { status: 500 }); + return NextResponse.json( + { error: 'Failed to update cart item', message: JSON.stringify(error) }, + { status: 500 } + ); } } @@ -45,6 +51,9 @@ export async function DELETE(req: NextRequest) { const cart = await storeApi.removeFromCart({ key }); return NextResponse.json(cart, { status: 200 }); } catch (error) { - return NextResponse.json({ error: 'Failed to remove item from cart', message: JSON.stringify(error) }, { status: 500 }); + return NextResponse.json( + { error: 'Failed to remove item from cart', message: JSON.stringify(error) }, + { status: 500 } + ); } } diff --git a/app/api/customer/route.ts b/app/api/customer/route.ts index 92dc984ef..2f05476d5 100644 --- a/app/api/customer/route.ts +++ b/app/api/customer/route.ts @@ -1,5 +1,5 @@ -import { woocommerce } from "lib/woocomerce/woocommerce"; -import { NextRequest, NextResponse } from "next/server"; +import { woocommerce } from 'lib/woocomerce/woocommerce'; +import { NextRequest, NextResponse } from 'next/server'; export async function POST(req: NextRequest) { try { @@ -9,4 +9,4 @@ export async function POST(req: NextRequest) { } catch (error) { return NextResponse.json({ error: 'Failed to add item to cart' }, { status: 500 }); } -} \ No newline at end of file +} diff --git a/app/checkout/page.tsx b/app/checkout/page.tsx index c8ff4bb97..632852f4f 100644 --- a/app/checkout/page.tsx +++ b/app/checkout/page.tsx @@ -74,7 +74,7 @@ export default function CheckoutPage() {

Shipping info

-
+
diff --git a/app/search/layout.tsx b/app/search/layout.tsx index f55b04097..51c4bf549 100644 --- a/app/search/layout.tsx +++ b/app/search/layout.tsx @@ -16,8 +16,7 @@ export default function SearchLayout({ children }: { children: React.ReactNode } {children} -
-
+