Skip to content

Commit

Permalink
Add api urls for ts-scanners
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksamies committed Aug 22, 2024
1 parent 1d5c762 commit f689657
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django/thunderstore/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
UserDeleteAPIView,
UserLinkedAccountDisconnectAPIView,
)
from thunderstore.plugins.registry import plugin_registry

cyberstorm_urls = [
path(
Expand Down Expand Up @@ -172,4 +173,4 @@
EditTeamMemberAPIView.as_view(),
name="cyberstorm.team.members.edit",
),
]
] + plugin_registry.get_api_urls()
4 changes: 4 additions & 0 deletions django/thunderstore/plugins/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def get_legacy_package_urls(cls) -> List[URLPattern]:
def get_new_package_urls(cls) -> List[URLPattern]:
return []

@classmethod
def get_api_urls(cls) -> List[URLPattern]:
return []

@classmethod
def get_package_tabs(
cls,
Expand Down
3 changes: 3 additions & 0 deletions django/thunderstore/plugins/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ def get_legacy_package_urls(self) -> List[URLPattern]:
def get_new_package_urls(self) -> List[URLPattern]:
return list(itertools.chain(*(x.get_new_package_urls() for x in self.plugins)))

def get_api_urls(self) -> List[URLPattern]:
return list(itertools.chain(*(x.get_api_urls() for x in self.plugins)))

def get_package_tabs(
self, user: "UserType", listing: "PackageListing"
) -> Dict[str, "PartialTab"]:
Expand Down

0 comments on commit f689657

Please sign in to comment.