(token, files, description = "ui5 web components playground example")
| 37 | }; |
| 38 | |
| 39 | export const createGist = async (token, files, description = "ui5 web components playground example") => { |
| 40 | const response = await fetch(`${NETLIFY_BASE_URL}/github-create-gist`, { |
| 41 | method: "POST", |
| 42 | headers: { |
| 43 | "Content-Type": "application/json", |
| 44 | "Authorization": `Bearer ${token}` |
| 45 | }, |
| 46 | body: JSON.stringify({ files, description }) |
| 47 | }); |
| 48 | |
| 49 | if (!response.ok) { |
| 50 | const errorData = await response.json().catch(() => ({})); |
| 51 | throw new Error(errorData.message || `server error: ${response.status}`); |
| 52 | } |
| 53 | |
| 54 | return response.json(); |
| 55 | }; |
| 56 | |
| 57 | /** |
| 58 | * Load and convert gist files to playground format |
no test coverage detected
searching dependent graphs…