import { NextResponse } from "next/server";

// Confirmed live: GET /user/horoscope/signs needs no Authorization
// header at all — unlike every other /user/horoscope/* endpoint, which
// is why this is its own dedicated route rather than folded into the
// [period] dynamic proxy (that one always requires the incoming
// Authorization header and only ever POSTs).
const API_URL = "https://api.astrology.togwe.com/api/user/horoscope/signs";

export async function GET() {
  try {
    const response = await fetch(API_URL, {
      method: "GET",
      headers: { Accept: "application/json" },
      cache: "no-store",
    });

    const data = await response.json();

    return NextResponse.json(data, { status: response.status });
  } catch (error) {
    console.error("Horoscope signs proxy error:", error);

    return NextResponse.json(
      { status: false, message: "Unable to connect to horoscope API." },
      { status: 500 },
    );
  }
}
