1const _fetch = async props => {
2 const { endpoint, options } = props
3 return await fetch(endpoint, options)
4 .then(async res => {
5 if (res.ok) {
6 return await res.clone().json().catch(() => res.text())
7 }
8 return false
9 })
10 .catch(err => {
11 console.error("api", "_fetch", "err", err)
12 return false
13 })
14}