fetch fix

This commit is contained in:
Kuba 2023-02-05 19:45:38 +01:00
parent 79a3ab85da
commit 69b9aed30f

View File

@ -1,6 +1,6 @@
<html lang="en"> <html lang="en">
<head> <head>
<script> <script>
async function parse(){ async function parse(){
document.getElementById("result").innerHTML = "Dodawanie pliku..." document.getElementById("result").innerHTML = "Dodawanie pliku..."
@ -12,9 +12,8 @@
document.getElementById("result").innerHTML = "Info" document.getElementById("result").innerHTML = "Info"
data = await resp.json() data = await resp.json()
resp_db = await fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET", body: ""}) fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET"})
var result = JSON.stringify(resp_db) .then((res) => {console.log(res);document.getElementById("test").innerHTML = JSON.stringify(res)})
document.getElementById("result").innerHTML = result
} }
</script> </script>
<title>Invoice parser</title> <title>Invoice parser</title>