Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions stac_fastapi/pgstac/models/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def link_next(self) -> Optional[Dict[str, Any]]:
if self.next is not None:
method = self.request.method
if method == "GET":
href = merge_params(self.url, {"token": f"next:{self.next}"})
url = self.resolve(f"collections/{self.collection_id}/items")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬 it seems that PagingLinks class is not only used in the /items endpoint but also in the all_collections method

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I missed that. I guess that change is not going to work then

href = merge_params(url, {"token": f"next:{self.next}"})
link = {
"rel": Relations.next.value,
"type": MimeTypes.geojson.value,
Expand All @@ -154,7 +155,8 @@ def link_prev(self) -> Optional[Dict[str, Any]]:
if self.prev is not None:
method = self.request.method
if method == "GET":
href = merge_params(self.url, {"token": f"prev:{self.prev}"})
url = self.resolve(f"collections/{self.collection_id}/items")
href = merge_params(url, {"token": f"prev:{self.prev}"})
return {
"rel": Relations.previous.value,
"type": MimeTypes.geojson.value,
Expand Down
Loading