fixes fixes fixes

This commit is contained in:
j 2021-11-24 09:20:50 +01:00
commit 59dbc98a76
11 changed files with 48 additions and 104 deletions

21
app/static/js/api.js Normal file
View file

@ -0,0 +1,21 @@
var cache = cache || {}
async function pandoraAPI(action, data) {
var url = pandoraURL + '/api/'
//var url = '/pandoraAPI/'
var key = JSON.stringify([action, data])
if (!cache[key]) {
var response = await fetch(url, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
action: action,
data: data
})
})
cache[key] = await response.json()
}
return cache[key]
}