(async () => {
  try {
    const data = await apiGet("/accounts/");
    const tbody = document.getElementById("accounts-body");

    data.forEach((a) => {
      const tr = document.createElement("tr");
      tr.innerHTML = `
        <td>${a.account_code}</td>
        <td>${a.account_name}</td>
        <td>${a.account_type}</td>
      `;
      tbody.appendChild(tr);
    });
  } catch (e) {
    alert(e.message);
  }
})();
