paolosantarsiero aac4af90ae fix: build
2024-12-31 11:37:43 +01:00

13 lines
433 B
TypeScript

import { woocommerce } from 'lib/woocomerce/woocommerce';
import { NextRequest, NextResponse } from 'next/server';
export async function POST(req: NextRequest) {
try {
const data = await req.json();
const cart = await woocommerce.post('customers', data);
return NextResponse.json(cart, { status: 200 });
} catch (error) {
return NextResponse.json({ error: 'Failed to add item to cart' }, { status: 500 });
}
}