mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-24 21:41:04 +02:00
feat: use the new DELETE /folder/{id} endpoint in cloud delete_collection
The compute API now exposes folder deletion (cascade: documents and
subfolders; 404 folder_not_found; 409 when descendants are still
queued/processing), so replace the not-supported error with the real call.
The endpoint's own 404 ('Folder not found.') is treated as idempotent
success and drops the cached folder id; a bare route-miss 404 from a server
without the endpoint still raises so the delete can't silently no-op
against old deployments. 409/5xx propagate with the cache intact.
This commit is contained in:
parent
47c9263379
commit
464d5658dd
1 changed files with 7 additions and 5 deletions
|
|
@ -209,11 +209,13 @@ class CloudBackend:
|
|||
except CollectionNotFoundError:
|
||||
return # already gone — delete is idempotent
|
||||
if folder_id:
|
||||
raise PageIndexError(
|
||||
f"Deleting a cloud collection is not supported by the PageIndex "
|
||||
f"API — delete folder '{name}' in the dashboard "
|
||||
"(https://dash.pageindex.ai) instead."
|
||||
)
|
||||
try:
|
||||
self._request("DELETE", f"/folder/{self._enc(folder_id)}/")
|
||||
except CloudAPIError as e:
|
||||
# a route-miss 404 (endpoint not deployed) must not read as deleted
|
||||
if not (e.status_code == 404 and "Folder not found" in str(e)):
|
||||
raise
|
||||
self._folder_id_cache.pop(name, None)
|
||||
|
||||
# ── Document management ───────────────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue