// jamaah.js — fetch jamaah summary
import { getJSON } from "../helpers/http.js";

// BASE di-set di index.php: window.API_BASE = "<?= base_url('pages/web_monitoring/php/'); ?>";
const BASE = window.API_BASE || "/sistem_informasi_masjid/pages/web_monitoring/php/";
const ENDPOINT = `${BASE}get_jamaah.php`;

export async function fetchJamaah() {
  try {
    const data = await getJSON(ENDPOINT);
    return data;
  } catch (err) {
    console.error("fetchJamaah error", err);
    return null;
  }
}
