import { NextRequest } from "next/server";

import { assertSameOrigin } from "@/lib/server/request-guards";
import { proxyHermesRequest } from "@/lib/server/hermes-proxy";

export async function POST(request: NextRequest) {
  const originError = assertSameOrigin(request);

  if (originError) {
    return originError;
  }

  return proxyHermesRequest(request, "/customers/import/commit");
}
