Compare commits
No commits in common. "7676fb2813375469a65ac9f4fab4b7f65333240a" and "1a54f7ab8e7a7717c7c65753dae0c283f396056b" have entirely different histories.
7676fb2813
...
1a54f7ab8e
@ -4,7 +4,11 @@
|
|||||||
|
|
||||||
<input type="email" id="form-email" placeholder="Email" required > <br>
|
<input type="email" id="form-email" placeholder="Email" required > <br>
|
||||||
<input type="text" id="form-username" placeholder="Username (Optional)" > <br>
|
<input type="text" id="form-username" placeholder="Username (Optional)" > <br>
|
||||||
<div id="lister-roles"></div>
|
<div id="lister-roles">
|
||||||
|
<!-- hardcoded -->
|
||||||
|
<label><input type="checkbox" name="roles" value="2">Admin</label>
|
||||||
|
<label><input type="checkbox" name="roles" value="3">Member</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
<p>You need to insert your password for confirm the invitation</p>
|
<p>You need to insert your password for confirm the invitation</p>
|
||||||
|
@ -9,9 +9,9 @@ sendHttpRequest("/api/auth/roles/list", "POST", null,
|
|||||||
const ls = JSON.parse(response);
|
const ls = JSON.parse(response);
|
||||||
|
|
||||||
ls.data.forEach(data => {
|
ls.data.forEach(data => {
|
||||||
const itemElement = document.createElement("div");
|
const postElement = document.createElement("div");
|
||||||
postElement.innerHTML = `<li>[${data.id}] ${data.name}: ${data.count} User(s)</li>`;
|
postElement.innerHTML = `<li>[${data.id}] ${data.name}: ${data.count} User(s)</li>`;
|
||||||
lister.appendChild(itemElement);
|
lister.appendChild(postElement);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, "application/json", `Bearer ${token}`
|
}, "application/json", `Bearer ${token}`
|
||||||
|
@ -34,22 +34,6 @@ 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