Added listmonk API call for published article

This commit is contained in:
hbrain 2026-06-07 13:06:43 +02:00
parent 52065707df
commit 3a0acc49a2
3 changed files with 289 additions and 73 deletions

View file

@ -1916,7 +1916,10 @@ async function handleSwitchToggle(form, checkbox){
}else{
data.delete(checkbox.name);
}
const useBusyOverlay = form.dataset.switch === 'show';
const busyLabel = checkbox.checked ? 'Showing article…' : 'Hiding article…';
checkbox.disabled = true;
if(useBusyOverlay) showThumbBusy(busyLabel);
try{
const res = await fetch('admin.php', { method: 'POST', body: data, credentials: 'same-origin', headers: { 'Accept': 'application/json' }});
const json = await res.json().catch(() => ({}));
@ -1929,6 +1932,7 @@ async function handleSwitchToggle(form, checkbox){
showToast(e.message || 'Switch update failed', false);
}finally{
checkbox.disabled = false;
if(useBusyOverlay) setTimeout(hideThumbBusy, 120);
}
}