Simplified fetching

This commit is contained in:
2023-06-13 14:52:50 +02:00
parent b9045a8013
commit fbd6ec8f3a

View File

@@ -23,10 +23,9 @@ async function submit() {
});
var responseBody = await fetch(request).then(async response => {
const text = await response.text();
return JSON.parse(text);
});
var responseBody = await fetch(request)
.then(response => response.json())
.then((body) => body);
result.value = responseBody.result;
}