Skip to content

Commit

Permalink
Merge pull request #146 from CameronRP/fix-salt-set-environment
Browse files Browse the repository at this point in the history
Fixed error with setting salt environment
  • Loading branch information
CameronRP authored Aug 30, 2024
2 parents b90ff8f + 20e6dd8 commit ad7112d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions static/js/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ window.onload = async function () {
};

async function setAutoUpdate(autoUpdate) {

var headers = new Headers(authHeaders);
headers.append("Content-Type", "application/x-www-form-urlencoded");
console.log("set auto update", autoUpdate);
var res = await fetch("/api/auto-update", {
method: "POST",
headers: authHeaders,
headers: headers,
body: new URLSearchParams({ autoUpdate: autoUpdate }),
});
if (!res.ok) {
Expand Down Expand Up @@ -224,14 +227,15 @@ function getEnvironmentState() {
}

async function setEnvironment() {
const selectedEnvironment =
document.getElementById("environment-select").value;
if (selectedEnvironment == "") {
alert('Please select an environment');
return;
}
$("#set-environment-button").attr("disabled", true);
$("#set-environment-button").html("Setting Environment");
const selectedEnvironment =
document.getElementById("environment-select").value;

headers = authHeaders;
headers.append("Content-Type", "application/json");
try {
Expand Down

0 comments on commit ad7112d

Please sign in to comment.