Skip to content

Commit

Permalink
Change path for public collections to avoid collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Nov 22, 2024
1 parent 0bee5f8 commit 8f7bae4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/btrixcloud/colls.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ async def download_collection(
return await colls.download_collection(coll_id, org)

@app.get(
"/orgs/{org_slug}/collections/public",
"/public-collections/{org_slug}",
tags=["collections"],
response_model=OrgPublicCollections,
)
Expand Down
4 changes: 2 additions & 2 deletions backend/test/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def test_list_public_collections(
org_name = data["name"]

# List public collections with no auth
r = requests.get(f"{API_PREFIX}/orgs/{org_slug}/collections/public")
r = requests.get(f"{API_PREFIX}/public-collections/{org_slug}")
assert r.status_code == 200
data = r.json()
assert data["name"] == org_name
Expand All @@ -767,7 +767,7 @@ def test_list_public_collections(
# Test non-existing slug - it should return a 404 specifying that
# public collections weren't found but not reveal whether or not
# an org exists with that slug
r = requests.get(f"{API_PREFIX}/orgs/nonexistentslug/collections/public")
r = requests.get(f"{API_PREFIX}/public-collections/nonexistentslug")
assert r.status_code == 404
assert r.json()["detail"] == "public_collections_not_found"

Expand Down

0 comments on commit 8f7bae4

Please sign in to comment.