From ff55c689db64bc13eafd3ba21b7669a9434eec0d Mon Sep 17 00:00:00 2001 From: Bryan Date: Sun, 20 Dec 2020 10:29:05 -0600 Subject: [PATCH] bug fix --- trigger.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/trigger.html b/trigger.html index fb2f4e9..d2b5a42 100644 --- a/trigger.html +++ b/trigger.html @@ -300,14 +300,13 @@ let delay = ""; let apiKey = ""; const unlockUrl = "https://ths.tnet.space/cgi-bin/unlock-main.cgi"; -// const unlockUrl = "https://ths.tnet.space/cgi-bin/doorcontrol-cgi/test.cgi"; // make fetch function that calls cgi script with attributes (device id, api key, delay) const unlockDoor = (dID, aK, d) => { - //fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) - fetch(unlockUrl) - .then(response => response.text()) - .then(data => messageContainer.innerHTML = data); + fetch(`${unlockUrl}?deviceID=${dID}&apiKey=${aK}&delay=${d}`) +// fetch(unlockUrl) + .then(response => response.json()) + .then(data => messageContainer.innerHTML = data.message); } const setSettings = () => {