Use base url in JS files

This commit is contained in:
Alex Ling
2020-05-23 13:15:54 +00:00
parent eefa8c3982
commit 4a59459773
6 changed files with 15 additions and 15 deletions
+4 -4
View File
@@ -22,7 +22,7 @@ const loadConfig = () => {
globalConfig.autoRefresh = $('#auto-refresh').prop('checked');
};
const remove = (id) => {
var url = '/api/admin/mangadex/queue/delete';
var url = base_url + 'api/admin/mangadex/queue/delete';
if (id !== undefined)
url += '?' + $.param({id: id});
console.log(url);
@@ -43,7 +43,7 @@ const remove = (id) => {
});
};
const refresh = (id) => {
var url = '/api/admin/mangadex/queue/retry';
var url = base_url + 'api/admin/mangadex/queue/retry';
if (id !== undefined)
url += '?' + $.param({id: id});
console.log(url);
@@ -67,7 +67,7 @@ const toggle = () => {
$('#pause-resume-btn').attr('disabled', '');
const paused = $('#pause-resume-btn').text() === 'Resume download';
const action = paused ? 'resume' : 'pause';
const url = `/api/admin/mangadex/queue/${action}`;
const url = `${base_url}api/admin/mangadex/queue/${action}`;
$.ajax({
type: 'POST',
url: url,
@@ -87,7 +87,7 @@ const load = () => {
console.log('fetching');
$.ajax({
type: 'GET',
url: '/api/admin/mangadex/queue',
url: base_url + 'api/admin/mangadex/queue',
dataType: 'json'
})
.done(data => {