// sumberdaya.js — fetch sumber daya list
import { getJSON } from "../helpers/http.js";

const BASE = window.API_BASE || "/sistem_informasi_masjid/pages/web_monitoring/php/";
const ENDPOINT = `${BASE}sumberdaya.php`;

export async function fetchSumberDaya(mode = "") {
  try {
    const url = mode === "check" ? `${ENDPOINT}?mode=check` : ENDPOINT;
    const data = await getJSON(url);
    return data;
  } catch (err) {
    console.error("fetchSumberDaya error", err);
    return null;
  }
}
