From 5d1dde8e10fdc329484d2d392842b8d09543d579 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Wed, 16 Aug 2023 13:34:16 +0900 Subject: [PATCH] Add stub API endpoint for user suggestion (api/v2/suggestions) --- api/urls.py | 3 +++ api/views/suggestions.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 api/views/suggestions.py diff --git a/api/urls.py b/api/urls.py index fd32e53e..5aed32d2 100644 --- a/api/urls.py +++ b/api/urls.py @@ -18,6 +18,7 @@ push, search, statuses, + suggestions, tags, timelines, trends, @@ -128,4 +129,6 @@ 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), ] diff --git a/api/views/suggestions.py b/api/views/suggestions.py new file mode 100644 index 00000000..209ddb92 --- /dev/null +++ b/api/views/suggestions.py @@ -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 []