lg-admin: do not check res value
This commit is contained in:
parent
2447735aec
commit
c20ad43758
1 changed files with 14 additions and 18 deletions
|
|
@ -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();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue