Skip to content
Snippets Groups Projects
Commit dbc3ac59 authored by Trirst's avatar Trirst
Browse files

Revert fetchAPI helper function

parent 608c9fc1
Branches
No related tags found
No related merge requests found
async function fetchAPI(endpoint, options) { async function fetchAPI(endpoint, options) {
const res = await fetch(endpoint, options); const res = await fetch(endpoint, options);
const contentType = res.headers.get('content-length'); const data = await res.json();
let data
if (!contentType.includes("0")) {
data = await res.json();
}
if (res.ok) { if (res.ok) {
return data; return data;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment