Added listmonk API call for published article
This commit is contained in:
parent
52065707df
commit
3a0acc49a2
3 changed files with 289 additions and 73 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue