|
|
|
@ -47,12 +47,16 @@ export const do_request = async (doc_id, variables, parse = true) => { |
|
|
|
const txt = await res.text(); |
|
|
|
const txt = await res.text(); |
|
|
|
|
|
|
|
|
|
|
|
if (!res.ok) { |
|
|
|
if (!res.ok) { |
|
|
|
|
|
|
|
console.error(txt); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (parse) { |
|
|
|
if (parse) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
res = JSON.parse(txt); |
|
|
|
res = JSON.parse(txt); |
|
|
|
|
|
|
|
if (res.errors != null) { |
|
|
|
|
|
|
|
console.error(JSON.stringify(res.errors)); |
|
|
|
|
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.error(e); |
|
|
|
console.error(e); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|