(path, options = {})
| 65 | } |
| 66 | |
| 67 | async function api(path, options = {}) { |
| 68 | const response = await fetch(path, { |
| 69 | headers: { "Content-Type": "application/json", ...(options.headers || {}) }, |
| 70 | ...options, |
| 71 | }); |
| 72 | if (!response.ok) { |
| 73 | throw new Error(`${response.status} ${response.statusText}`); |
| 74 | } |
| 75 | return response.json(); |
| 76 | } |
| 77 | |
| 78 | async function load() { |
| 79 | showMessage("Loading admin config"); |
no test coverage detected