Add getsecret method
This commit is contained in:
@@ -24,7 +24,26 @@ Object.defineProperty(String.prototype, 'hashCode', {
|
||||
}
|
||||
});
|
||||
|
||||
function render_table(data) {
|
||||
async function get_secret(user) {
|
||||
|
||||
const r = await fetch(admin_api_path + 'get_secret', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({
|
||||
uuid: user.uuid
|
||||
}),
|
||||
});
|
||||
console.log(r);
|
||||
|
||||
if (r.status !== 200) {
|
||||
console.log("oh no");
|
||||
return;
|
||||
}
|
||||
|
||||
const data = await r.json();
|
||||
return data[user.uuid]
|
||||
}
|
||||
|
||||
async function render_table(data) {
|
||||
const users = Object.values(data.users);
|
||||
|
||||
const newusername = document.querySelector("#newusername");
|
||||
@@ -65,9 +84,13 @@ function render_table(data) {
|
||||
plusbutton = clone.querySelector("#plusbutton")
|
||||
;
|
||||
|
||||
name.innerText = user.name;
|
||||
cur.innerText = user.score;
|
||||
max.innerText = user.maxscore;
|
||||
|
||||
const secret = await get_secret(user);
|
||||
name.innerText = user.name;
|
||||
name.href = `../dealer/${secret}`;
|
||||
// console.log(secret);
|
||||
|
||||
//const button = document.getElementById("plusbutton");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user