From ea96df1774caede359111a98a2c2fc559fd39334 Mon Sep 17 00:00:00 2001 From: arianagiroux Date: Thu, 4 Aug 2022 17:40:31 -0600 Subject: [PATCH] Implements function to pass tags updates to python - also removes main function from javascript file --- static/script.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/static/script.js b/static/script.js index ec6c773..c5c5a60 100644 --- a/static/script.js +++ b/static/script.js @@ -31,8 +31,16 @@ async function updateStreamTitle(value) { await uiUpdateOnce(); } -async function Main() { - await uiUpdate() +async function updateTags(value) { + // this function simply passes data along to the python script, and allows + // python to handle data processing + response = await fetch('http://127.0.0.1:5000/api/update/servertags', + { + method:'POST', + body:JSON.stringify(value) + } + ); + await uiUpdateOnce(); } continuousUiUpdate()