diff --git a/pages/public/users.html b/pages/public/users.html
index 189df73..346cf9d 100644
--- a/pages/public/users.html
+++ b/pages/public/users.html
@@ -1,5 +1,30 @@
-
+
+Invitation
+
+
+
+
+
+
+
+
+
+
+You need to insert your password for confirm the invitation
+
+
+
+
+
+
+ Loading... Please wait...
+
+
+User List
+
+
+
diff --git a/static/js/users.js b/static/js/users.js
index 5541226..5fefbe4 100644
--- a/static/js/users.js
+++ b/static/js/users.js
@@ -1,5 +1,6 @@
-var token = document.getElementById("form-token" ).value;
-const lister = document.getElementById("lister");
+var token = document.getElementById("form-token" ).value;
+const listerUser = document.getElementById("lister-user" );
+const listerRoles = document.getElementById("lister-roles" );
sendHttpRequest("/api/auth/users/list", "POST", null,
function (error, response) {
@@ -27,9 +28,27 @@ sendHttpRequest("/api/auth/users/list", "POST", null,
`;
- lister.appendChild(itemElement);
+ listerUser.appendChild(itemElement);
});
}
}, "application/json", `Bearer ${token}`
);
+function invite() {
+ const checkedRoles = Array
+ .from(document.querySelectorAll('input[name="roles"]:checked'))
+ .map(cb => Number(cb.value)); // Convert into number
+ const email = document.getElementById('form-email').value;
+ const username = document.getElementById('form-username').value;
+ const password = document.getElementById('form-password').value;
+
+ console.log({
+ email,
+ username,
+ password,
+ roles: checkedRoles // Example: [2, 3]
+ });
+
+ // Next command here
+}
+