Add stub API endpoint for user suggestion (api/v2/suggestions) (#631)

This commit is contained in:
TAKAHASHI Shuuji 2023-08-17 17:11:06 +09:00 committed by GitHub
parent 1262c619bb
commit 679f0def99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -18,6 +18,7 @@ from api.views import (
push,
search,
statuses,
suggestions,
tags,
timelines,
trends,
@ -128,4 +129,6 @@ urlpatterns = [
path("v1/trends/tags", trends.trends_tags),
path("v1/trends/statuses", trends.trends_statuses),
path("v1/trends/links", trends.trends_links),
# Suggestions
path("v2/suggestions", suggestions.suggested_users),
]

16
api/views/suggestions.py Normal file
View File

@ -0,0 +1,16 @@
from django.http import HttpRequest
from hatchway import api_view
from api import schemas
from api.decorators import scope_required
@scope_required("read")
@api_view.get
def suggested_users(
request: HttpRequest,
limit: int = 10,
offset: int | None = None,
) -> list[schemas.Account]:
# We don't implement this yet
return []