lg-admin: do not check res value

This commit is contained in:
Alexandre Iooss 2022-03-09 17:21:52 +01:00
parent 2447735aec
commit c20ad43758

View file

@ -54,14 +54,12 @@ class lgAdmin {
body: data, body: data,
credentials: 'same-origin', credentials: 'same-origin',
}).then(res => { }).then(res => {
if(res.ok) { console.log("Deletion complete, response:", res);
console.log("Deletion complete, response:", res);
// Remove HTML element // Remove HTML element
document.querySelectorAll(`[data-slide-name='${this.photoId}']`)[0].remove() document.querySelectorAll(`[data-slide-name='${this.photoId}']`)[0].remove()
this.core.goToNextSlide(); this.core.goToNextSlide();
this.core.refresh(); this.core.refresh();
}
}); });
} }
} }
@ -79,18 +77,16 @@ class lgAdmin {
body: data, body: data,
credentials: 'same-origin', credentials: 'same-origin',
}).then(res => { }).then(res => {
if(res.ok) { console.log("Report complete, response:", res);
console.log("Report complete, response:", res);
// Update HTML element // Update HTML element
const thumbnail = document.querySelectorAll(`[data-slide-name='${this.photoId}']`)[0]; const thumbnail = document.querySelectorAll(`[data-slide-name='${this.photoId}']`)[0];
if (!this.isStaff) { if (!this.isStaff) {
thumbnail.remove() thumbnail.remove()
this.core.goToNextSlide(); this.core.goToNextSlide();
this.core.refresh(); this.core.refresh();
} else { } else {
location.reload(); location.reload();
}
} }
}); });
} }