List of roles in the users
This commit is contained in:
parent
99bd1844a8
commit
7676fb2813
@ -34,6 +34,22 @@ sendHttpRequest("/api/auth/users/list", "POST", null,
|
|||||||
}, "application/json", `Bearer ${token}`
|
}, "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 = `<label><input type="checkbox" name="roles" value="${row.id}">${row.name}</label>`;
|
||||||
|
listerRoles.appendChild(itemElement);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, "application/json", `Bearer ${token}`
|
||||||
|
);
|
||||||
|
|
||||||
function invite() {
|
function invite() {
|
||||||
const checkedRoles = Array
|
const checkedRoles = Array
|
||||||
.from(document.querySelectorAll('input[name="roles"]:checked'))
|
.from(document.querySelectorAll('input[name="roles"]:checked'))
|
||||||
|
Loading…
Reference in New Issue
Block a user