mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Move schedule edit delete to API call
This commit is contained in:
parent
8ac0449bcb
commit
addd878942
@ -286,21 +286,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function del_task(sch_id, id) {
|
async function del_task(sch_id, id) {
|
||||||
var token = getCookie("_xsrf")
|
var token = getCookie("_xsrf")
|
||||||
|
|
||||||
$.ajax({
|
let res = await fetch(`/api/v2/servers/${id}/tasks/${sch_id}`, {
|
||||||
type: "DELETE",
|
method: 'DELETE',
|
||||||
headers: { 'X-XSRFToken': token },
|
headers: {
|
||||||
url: '/ajax/del_task?server_id=' + id + '&schedule_id=' + sch_id,
|
'token': token,
|
||||||
data: {
|
|
||||||
schedule_id: sch_id,
|
|
||||||
id: id
|
|
||||||
},
|
|
||||||
success: function (data) {
|
|
||||||
location.reload();
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
let responseData = await res;
|
||||||
|
if (responseData.statusText === "OK") {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function startup() {
|
function startup() {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user