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