Skip to content

Commit

Permalink
Updating collection self link for collections page.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysrevans3 committed Sep 6, 2024
1 parent 4fa6546 commit 2f3c394
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stac_fastapi/core/stac_fastapi/core/models/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ class CollectionLinks(BaseLinks):
collection_id: str = attr.ib()
extensions: List[str] = attr.ib(default=attr.Factory(list))

def link_self(self) -> Dict:
"""Return the self link."""
return dict(
rel=Relations.self.value,
type=MimeTypes.json.value,
href=urljoin(self.base_url, f"collections/{self.collection_id}"),
)

def link_parent(self) -> Dict[str, Any]:
"""Create the `parent` link."""
return dict(rel=Relations.parent, type=MimeTypes.json.value, href=self.base_url)
Expand Down

0 comments on commit 2f3c394

Please sign in to comment.