collection delete: (#896)

set delete endpoint to use DELETE verb, fix for #869
This commit is contained in:
Ilya Kreymer 2023-05-29 18:19:04 -07:00 committed by GitHub
parent df4c4e6c5a
commit 4d30a64bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -478,8 +478,8 @@ def init_collections_api(app, mdb, crawls, orgs, crawl_manager):
coll_id, crawlList.crawlIds, org coll_id, crawlList.crawlIds, org
) )
@app.get( @app.delete(
"/orgs/{oid}/collections/{coll_id}/delete", "/orgs/{oid}/collections/{coll_id}",
tags=["collections"], tags=["collections"],
) )
async def delete_collection( async def delete_collection(

View File

@ -357,8 +357,8 @@ def test_filter_sort_collections(
def test_delete_collection(crawler_auth_headers, default_org_id, crawler_crawl_id): def test_delete_collection(crawler_auth_headers, default_org_id, crawler_crawl_id):
# Delete second collection # Delete second collection
r = requests.get( r = requests.delete(
f"{API_PREFIX}/orgs/{default_org_id}/collections/{_second_coll_id}/delete", f"{API_PREFIX}/orgs/{default_org_id}/collections/{_second_coll_id}",
headers=crawler_auth_headers, headers=crawler_auth_headers,
) )
assert r.status_code == 200 assert r.status_code == 200