feat(F-069): completed feature

This commit is contained in:
chattie
2026-08-19 18:09:23 +02:00
parent ba2ac939c7
commit ddcf2e0c28
14 changed files with 437 additions and 50 deletions

View File

@@ -0,0 +1,16 @@
import { NextRequest, NextResponse } from 'next/server';
const API = process.env.NEXT_PUBLIC_API_URL ?? 'http://127.0.0.1:3000';
export async function GET(request: NextRequest) {
const { searchParams } = new URL(request.url);
const qs = searchParams.toString();
const url = `${API}/shipping/methods${qs ? `?${qs}` : ''}`;
try {
const res = await fetch(url, { cache: 'no-store' });
const body = await res.json().catch(() => ({ items: [] }));
return NextResponse.json(body, { status: res.status });
} catch {
return NextResponse.json({ items: [] }, { status: 502 });
}
}