chore: transfer repo

This commit is contained in:
Danijel
2026-01-19 20:21:14 +01:00
commit 7d2fb0c737
213 changed files with 18085 additions and 0 deletions

21
app/api/products/route.ts Normal file
View File

@@ -0,0 +1,21 @@
import { getBoxProducts, getProducts } from 'lib/shopify';
import { NextResponse } from 'next/server';
export async function GET(request: Request) {
try {
// Get query parameters
const { searchParams } = new URL(request.url);
const type = searchParams.get('type');
if (type === 'boxes') {
const boxProducts = await getBoxProducts({});
return NextResponse.json({ products: boxProducts });
} else {
const allProducts = await getProducts({});
return NextResponse.json({ products: allProducts });
}
} catch (error) {
console.error('Error fetching products:', error);
return NextResponse.json({ error: 'Failed to fetch products' }, { status: 500 });
}
}

View File

@@ -0,0 +1,6 @@
import { revalidate } from 'lib/shopify';
import { NextRequest, NextResponse } from 'next/server';
export async function POST(req: NextRequest): Promise<NextResponse> {
return revalidate(req);
}