import { NextRequest, NextResponse } from "next/server";

const API_URL = "https://api.astrology.togwe.com/api/astrologer/logout";

export async function POST(request: NextRequest) {
  const token = request.headers.get("authorization");

  const response = await fetch(API_URL, {
    method: "POST",
    headers: {
      Authorization: token || "",
      "Content-Type": "application/json",
    },
    cache: "no-store",
  });

  const data = await response.json();

  return NextResponse.json(data, { status: response.status });
}
