MarseyWorld/files/assets/js/group_members_owner.js

29 lines
737 B
JavaScript
Raw Normal View History

2023-02-25 21:44:02 +00:00
const members_tbody = document.getElementById('Members_tbody')
2023-02-26 00:05:37 +00:00
function approve_membership(t, group, uid) {
url = `/!${group}/${uid}/approve`
2023-02-24 19:29:07 +00:00
postToast(t, url,
{
},
() => {
2023-02-25 21:44:02 +00:00
document.getElementById(`kick-${uid}`).classList.remove('d-none')
document.getElementById(`time-${uid}`).innerHTML = formatDate(new Date());
document.getElementById(`counter-${uid}`).innerHTML = parseInt(members_tbody.lastElementChild.firstElementChild.innerHTML) + 1
members_tbody.append(document.getElementById(uid));
t.parentElement.remove()
2023-02-24 19:29:07 +00:00
}
);
}
2023-02-26 00:05:37 +00:00
function reject_membership(t, group, uid) {
url = `/!${group}/${uid}/reject`
2023-02-24 19:29:07 +00:00
postToast(t, url,
{
},
() => {
2023-02-25 21:44:02 +00:00
t.parentElement.parentElement.parentElement.remove();
2023-02-24 19:29:07 +00:00
}
);
}