var token = document.getElementById("form-token" ).value; const lister = document.getElementById("lister"); sendHttpRequest("/api/auth/roles/list", "POST", null, function (error, response) { if (error) console.error("Error:", error); else { console.log("JSON Response:", response); const ls = JSON.parse(response); ls.data.forEach(data => { const postElement = document.createElement("div"); postElement.innerHTML = `
  • [${data.id}] ${data.name} - Total user(s): ${data.count}
  • `; lister.appendChild(postElement); }); } }, "application/json", `Bearer ${token}` );