Add command to default actions

This commit is contained in:
Andrew 2023-05-21 20:06:01 -04:00
parent cbfa40ce8d
commit ef3f60e180

View File

@ -273,6 +273,9 @@
if ($("#difficulty").val() == "reaction"){
formDataObject.interval_type = "reaction";
}
if ($("action").val() != "command"){
formDataObject.command = formDataObject.action + "_server";
}
if (formDataObject.cron_string != ""){
formDataObject.interval_type = '';
}
@ -280,8 +283,6 @@
// Format the plain form data as JSON
let formDataJsonString = JSON.stringify(formDataObject, replacer);
console.log(formDataJsonString);
let res = await fetch(`/api/v2/servers/${serverId}/tasks/`, {
method: 'POST',
headers: {
@ -317,6 +318,9 @@
if ($("#difficulty").val() == "reaction"){
formDataObject.interval_type = "reaction";
}
if ($("#action").val() != "command"){
formDataObject.command = formDataObject.action + "_server";
}
if (formDataObject.cron_string != ""){
formDataObject.interval_type = '';
}