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

export async function POST(req: NextRequest) {
  try {
    const auth = req.headers.get("authorization");

    const response = await fetch(
      "https://api.astrology.togwe.com/api/user/astrologers/list",
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: auth ?? "",
        },
        body: JSON.stringify({}),
      }
    );

    const data = await response.json();

    return NextResponse.json(data, {
      status: response.status,
    });
  } catch (e) {
    console.log(e);

    return NextResponse.json(
      {
        message: "Server Error",
      },
      {
        status: 500,
      }
    );
  }
}