change some variable names

master
Bryan 2020-12-20 00:51:52 -06:00
parent f8197e8eb0
commit 2305a0f35c
1 changed files with 3 additions and 3 deletions

View File

@ -296,14 +296,14 @@
const apiKeyInput = document.querySelector("#api-key"); const apiKeyInput = document.querySelector("#api-key");
const showDelay = document.querySelector("#show-delay"); const showDelay = document.querySelector("#show-delay");
let deviceID = ""; global deviceID = "";
let delay = ""; let delay = "";
let apiKey = ""; let apiKey = "";
const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/unlock-main.cgi"; const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/unlock-main.cgi";
// make fetch function that calls cgi script with attributes (device id, api key, delay) // make fetch function that calls cgi script with attributes (device id, api key, delay)
const unlockDoor = (deviceID, apiKey, delay) => { const unlockDoor = (dID, aK, d) => {
fetch(`${unlockUrl}?deviceID=${deviceID}&apiKey=${apiKey}&delay=${delay}`) fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`)
.then(response => response.json()) .then(response => response.json())
.then(data => messageContainer.innerHTML = data.message); .then(data => messageContainer.innerHTML = data.message);
} }