mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Redirect to the download manager after adding jobs to the queue
This commit is contained in:
parent
4f01aba3e1
commit
fecb96c91b
@ -40,7 +40,15 @@ const download = () => {
|
|||||||
})
|
})
|
||||||
.done(data => {
|
.done(data => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
console.log('post succeed');
|
if (data.error) {
|
||||||
|
alert('danger', `Failed to add chapters to the download queue. Error: ${data.error}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const successCount = parseInt(data.success);
|
||||||
|
const failCount = parseInt(data.fail);
|
||||||
|
UIkit.modal.confirm(`${successCount} of ${successCount + failCount} chapters added to the download queue. Proceed to the download manager?`).then(() => {
|
||||||
|
window.location.href = '/admin/downloads';
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.fail((jqXHR, status) => {
|
.fail((jqXHR, status) => {
|
||||||
alert('danger', `Failed to add chapters to the download queue. Error: [${jqXHR.status}] ${jqXHR.statusText}`);
|
alert('danger', `Failed to add chapters to the download queue. Error: [${jqXHR.status}] ${jqXHR.statusText}`);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user