* Delete an entire vector collection
(collectionId)
| 481 | * Delete an entire vector collection |
| 482 | */ |
| 483 | async function apiDeleteCollection(collectionId) { |
| 484 | ensureVectorConfig(); |
| 485 | |
| 486 | const response = await fetch('/api/vector/purge', { |
| 487 | method: 'POST', |
| 488 | headers: getRequestHeaders(), |
| 489 | credentials: 'same-origin', |
| 490 | body: JSON.stringify({ |
| 491 | collectionId: collectionId, |
| 492 | source: getVectorSettings().source, |
| 493 | }), |
| 494 | }); |
| 495 | |
| 496 | if (!response.ok) { |
| 497 | const errorText = await response.text(); |
| 498 | throw new Error(`Failed to purge collection ${collectionId}. Status: ${response.status}. Message: ${errorText}`); |
| 499 | } |
| 500 | |
| 501 | return true; |
| 502 | } |
| 503 | |
| 504 | /** |
| 505 | * Update chunks in the library with modified data from chunk visualizer |
no test coverage detected