From 7676fb2813375469a65ac9f4fab4b7f65333240a Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Wed, 13 Aug 2025 07:27:21 +0700 Subject: [PATCH] List of roles in the users --- static/js/users.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/static/js/users.js b/static/js/users.js index 5fefbe4..90286ec 100644 --- a/static/js/users.js +++ b/static/js/users.js @@ -34,6 +34,22 @@ sendHttpRequest("/api/auth/users/list", "POST", null, }, "application/json", `Bearer ${token}` ); +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(row => { + const itemElement = document.createElement("div"); + itemElement.innerHTML = ``; + listerRoles.appendChild(itemElement); + }); + } + }, "application/json", `Bearer ${token}` +); + function invite() { const checkedRoles = Array .from(document.querySelectorAll('input[name="roles"]:checked'))