(table: string, handle: string)
| 67 | } |
| 68 | |
| 69 | const deleteShape = async (table: string, handle: string) => { |
| 70 | const deleteUrl = new URL(ELECTRIC_URL) |
| 71 | deleteUrl.searchParams.set('table', table) |
| 72 | deleteUrl.searchParams.set('handle', handle) |
| 73 | const res = await fetch(deleteUrl, { |
| 74 | method: 'DELETE', |
| 75 | }) |
| 76 | if (res.status === 404) { |
| 77 | // Nothing to delete |
| 78 | return |
| 79 | } |
| 80 | if (!res.ok) { |
| 81 | throw new Error(`Error deleting shape: ${res.statusText}`) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | const deleteAllShapes = async () => { |
| 86 | for (const [handle, table] of shapeHandles.entries()) { |
no outgoing calls
no test coverage detected