diff --git a/photologue/static/lightgallery/plugins/admin/lg-admin.js b/photologue/static/lightgallery/plugins/admin/lg-admin.js index 1fbdd8f..4092ee4 100644 --- a/photologue/static/lightgallery/plugins/admin/lg-admin.js +++ b/photologue/static/lightgallery/plugins/admin/lg-admin.js @@ -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(); } }); }