Skip to content

Commit af9d9b8

Browse files
committed
coderabbit reviews
1 parent aa4e1a1 commit af9d9b8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

backend/app/api/routes/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def collection_info(
203203

204204
if include_docs:
205205
document_collection_crud = DocumentCollectionCrud(session)
206-
documents = document_collection_crud.read(collection, limit)
206+
documents = document_collection_crud.read(collection, skip=None, limit=limit)
207207

208208
storage = None
209209
if include_url and documents:

backend/app/tests/api/routes/collections/test_collection_info.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def test_collection_info_include_docs_and_url(
191191
client: TestClient,
192192
db: Session,
193193
user_api_key_header,
194-
):
194+
) -> None:
195195
"""
196196
Test that when include_docs=true and include_url=true,
197197
the endpoint returns documents with their URLs.
@@ -218,6 +218,9 @@ def test_collection_info_include_docs_and_url(
218218
assert isinstance(docs, list)
219219
assert len(docs) >= 1
220220

221-
# Verify document has URL field when include_url=true
222-
doc = docs[0]
221+
doc_ids = {d["id"] for d in docs}
222+
assert str(document.id) in doc_ids
223+
224+
doc = next(d for d in docs if d["id"] == str(document.id))
225+
assert "signed_url" in doc
223226
assert doc["signed_url"].startswith("https://")

0 commit comments

Comments
 (0)