export default function useSiteEntryPassSettings() {
  function getBySiteId(siteId: string) {
    return useNuxtApp().$api<Record<string, any>>(
      `/api/access-management/settings/${siteId}`,
      {
        method: "GET",
      }
    );
  }

  function getById(id: string) {
    return useNuxtApp().$api<Record<string, any>>(
      `/api/site-entrypass-settings/${id}`,
      {
        method: "GET",
      }
    );
  }

  function save(value: any) {
    return useNuxtApp().$api<Record<string, any>>(
      "/api/access-management/settings",
      {
        method: "POST",
        body: value,
      }
    );
  }

  return {
    getBySiteId,
    getById,
    save,
  };
}
