proper functoin calls for faction data
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
async function updateEnemy() {
|
||||
const factionId = parseInt(document.getElementById("enemyId").value);
|
||||
const interval = parseInt(document.getElementById("refreshInterval").value);
|
||||
|
||||
if (!factionId || !interval) {
|
||||
alert("Please enter Enemy Faction ID and Refresh Interval!");
|
||||
return;
|
||||
}
|
||||
|
||||
await fetch(`/api/update_enemy_faction`, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({ faction_id: factionId, interval: interval })
|
||||
});
|
||||
}
|
||||
|
||||
async function updateFriendly() {
|
||||
const factionId = parseInt(document.getElementById("friendlyId").value);
|
||||
|
||||
if (!factionId) {
|
||||
alert("Please enter Friendly Faction ID!");
|
||||
return;
|
||||
}
|
||||
|
||||
const interval = parseInt(document.getElementById("refreshInterval").value);
|
||||
if (!interval) {
|
||||
alert("Please enter Refresh Interval!");
|
||||
return;
|
||||
}
|
||||
|
||||
await fetch(`/api/update_friendly_faction`, {
|
||||
method: "POST",
|
||||
headers: {"Content-Type": "application/json"},
|
||||
body: JSON.stringify({ faction_id: factionId, interval: interval })
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user