fetch fix

This commit is contained in:
Kuba 2023-02-05 19:40:55 +01:00
parent 7a5fae6dec
commit 79a3ab85da

View File

@ -2,6 +2,7 @@
<head>
<script>
async function parse(){
document.getElementById("result").innerHTML = "Dodawanie pliku..."
var data = new FormData()
data.append('file', document.getElementById("docpicker").files[0])
@ -11,15 +12,16 @@
document.getElementById("result").innerHTML = "Info"
data = await resp.json()
resp_db = await fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET", body: data_db})
var result = JSON.stringify(data_db)
resp_db = await fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET", body: ""})
var result = JSON.stringify(resp_db)
document.getElementById("result").innerHTML = result
}
</script>
<title>Chmura</title>
<title>Invoice parser</title>
</head>
<body>
<input type="file" id="docpicker" accept=".pdf" onchange="parse()" />
<p id="result"></p>
<p id="result">...</p>
<p id="test">...</p>
</body>
</html>