|
|
|
@ -61,12 +61,16 @@ function handleSettigns(event)
|
|
|
|
|
popup.classList.remove('hidden');
|
|
|
|
|
popup.children[1].textContent = guild.name;
|
|
|
|
|
popup.children[1].id = guild.id;
|
|
|
|
|
let music = document.getElementById('music')
|
|
|
|
|
let music = document.getElementById('music');
|
|
|
|
|
music.textContent = guild.music? 'check_box' :'check_box_outline_blank';
|
|
|
|
|
let strikes = document.getElementById('strikes')
|
|
|
|
|
let strikes = document.getElementById('strikes');
|
|
|
|
|
strikes.textContent = guild.strikes? 'check_box' :'check_box_outline_blank';
|
|
|
|
|
let allowInvites = document.getElementById('allowInvites');
|
|
|
|
|
allowInvites.textContent = guild.allowInvites? 'check_box' : 'check_box_outline_blank';
|
|
|
|
|
music.onclick = requestChange;
|
|
|
|
|
strikes.onclick = requestChange;
|
|
|
|
|
allowInvites.onclick = requestChange;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleClose(element)
|
|
|
|
@ -82,7 +86,7 @@ function handleClose(element)
|
|
|
|
|
}
|
|
|
|
|
async function requestChange()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
console.log('here')
|
|
|
|
|
return await fetch(`${window.location.origin}/api/change`,
|
|
|
|
|
{
|
|
|
|
|
method: "POST",
|
|
|
|
@ -101,6 +105,8 @@ async function requestChange()
|
|
|
|
|
music.textContent = res.music? 'check_box' :'check_box_outline_blank';
|
|
|
|
|
let strikes = document.getElementById('strikes')
|
|
|
|
|
strikes.textContent = res.strikes? 'check_box' :'check_box_outline_blank';
|
|
|
|
|
let allowInvites = document.getElementById('allowInvites');
|
|
|
|
|
allowInvites.textContent = res.allowInvites? 'check_box' : 'check_box_outline_blank';
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(console.error);
|
|
|
|
|