Simplify the download queue tasks APIs

This commit is contained in:
Alex Ling
2020-03-11 18:11:32 +00:00
parent 36034042f2
commit 943076ccf7
2 changed files with 19 additions and 36 deletions

View File

@@ -22,10 +22,10 @@ const loadConfig = () => {
globalConfig.autoRefresh = $('#auto-refresh').prop('checked');
};
const remove = (id) => {
var url = '/api/admin/mangadex/queue/delete/';
if (id !== undefined) {
url += id;
}
var url = '/api/admin/mangadex/queue/delete';
if (id !== undefined)
url += '?' + $.param({id: id});
console.log(url);
$.ajax({
type: 'POST',
url: url,
@@ -43,10 +43,10 @@ const remove = (id) => {
});
};
const refresh = (id) => {
var url = '/api/admin/mangadex/queue/retry/';
if (id !== undefined) {
url += id;
}
var url = '/api/admin/mangadex/queue/retry';
if (id !== undefined)
url += '?' + $.param({id: id});
console.log(url);
$.ajax({
type: 'POST',
url: url,