Skip to content

Commit

Permalink
Placeholder documentation for api/v3/feeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Cqctxs committed Feb 6, 2024
1 parent a065d43 commit a3c5160
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
2 changes: 1 addition & 1 deletion core/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
name="api_term_schedule_week",
),
path("v3/staff", staff, name="api_staff3"),
path("v3/feeds", feeds, name="api_feeds3"),
path("v3/feeds", Feeds.as_view(), name="api_feeds3"),
path("v3/obj/user/me/delete", UserDeleteView.as_view(), name="api3_user_delete"),
path(
"v3/obj/user/me/restore",
Expand Down
32 changes: 22 additions & 10 deletions core/api/views/feeds.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
from django.conf import settings
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.views import APIView
from drf_spectacular.utils import extend_schema, OpenApiExample

__all__ = ["feeds"]
@extend_schema(
description="Returns announcement feeds.",
responses={200: {"announcements": []}},
examples=[
OpenApiExample(
name="Feeds",
response_only=True,
status_codes=[200],
value=[
{"announcement1": "placeholder"},
{"announcement2": "placeholder"}
],
)
],
)
class Feeds(APIView):
"""Returns Announcement feeds."""


@api_view()
def feeds(request):
"""
Returns Announcement feeds.
https://noi.nyiyui.ca/k/1063/5041#Get_Feeds
"""
return Response(list(settings.ANNOUNCEMENTS_CUSTOM_FEEDS))
@staticmethod
def get(request):
return Response(list(settings.ANNOUNCEMENTS_CUSTOM_FEEDS))
2 changes: 1 addition & 1 deletion core/api/views/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get(request) -> Dict[str, str]:
"cta_label": "string",}},
examples=[
OpenApiExample(
name="Banner",
name="Banners",
response_only=True,
status_codes=[200],
value={
Expand Down

0 comments on commit a3c5160

Please sign in to comment.