import { hasLotteryAdminApiBaseUrl, publicAdminRequest } from "@/lib/admin-http";
import type { DrawCurrentSnapshot } from "@/types/api/public-draw";

import { API_V1_PREFIX } from "@/api/paths";

/** 大厅当前期（无需 Bearer） */
export async function getDrawCurrent(): Promise<DrawCurrentSnapshot | null> {
  if (!hasLotteryAdminApiBaseUrl()) {
    return null;
  }
  try {
    return await publicAdminRequest<DrawCurrentSnapshot | null>({
      url: `${API_V1_PREFIX}/draw/current`,
      method: "GET",
    });
  } catch {
    return null;
  }
}
