| | |
| | | ignore: [], //any filters to ignore when filtering store locally |
| | | required: null, |
| | | |
| | | isAuth: false, |
| | | |
| | | // Cache |
| | | TTL: 3600000, // 1 hour |
| | | useHttpCaching: true, |
| | |
| | | const controller = new AbortController(); |
| | | store.currentRequest = controller; |
| | | |
| | | const response = await fetch(url, { |
| | | method: 'GET', |
| | | headers, |
| | | signal: controller.signal |
| | | }); |
| | | let response; |
| | | if (store.isAuth) { |
| | | response = await window.auth.fetch(url, { |
| | | method: 'GET', |
| | | headers, |
| | | signal: controller.signal |
| | | }); |
| | | } else { |
| | | response = await fetch(url, { |
| | | method: 'GET', |
| | | headers, |
| | | signal: controller.signal |
| | | }); |
| | | } |
| | | |
| | | if (!response.ok) { |
| | | // Access the error details from the response body |
| | | const errorBody = await response.text(); |