import { NextResponse } from "next/server"; import { callMobileApi } from "@/app/lib/server/mobileApi"; import { getToken } from "@/app/lib/server/session"; import { errorResponse, unauthorized } from "@/app/lib/server/apiRoute"; import type { SellableCountry } from "@/app/lib/types"; // GET -> /api/public/countries: the sellable countries (code, name, currency) the product editor prices in. export async function GET() { const token = await getToken(); if (!token) return unauthorized(); const result = await callMobileApi("/api/public/countries", { token }); if (!result.ok) return errorResponse(result); return NextResponse.json(result.data); }