mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-01-02 01:47:04 -05:00
feat: Implement initial schema and add various API, service, and management command enhancements across the application.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
from django.utils import timezone
|
||||
from drf_spectacular.utils import extend_schema
|
||||
from rest_framework.permissions import AllowAny
|
||||
@@ -13,6 +12,7 @@ class DiscoveryAPIView(APIView):
|
||||
"""
|
||||
API endpoint for discovery content (Top Lists, Opening/Closing Soon).
|
||||
"""
|
||||
|
||||
permission_classes = [AllowAny]
|
||||
|
||||
@extend_schema(
|
||||
@@ -68,7 +68,7 @@ class DiscoveryAPIView(APIView):
|
||||
"recently_closed": {
|
||||
"parks": self._serialize(recently_closed_parks, "park"),
|
||||
"rides": self._serialize(recently_closed_rides, "ride"),
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
return Response(data)
|
||||
@@ -83,14 +83,13 @@ class DiscoveryAPIView(APIView):
|
||||
"average_rating": item.average_rating,
|
||||
}
|
||||
if type_ == "park":
|
||||
data.update({
|
||||
"city": item.location.city if item.location else None,
|
||||
"state": item.location.state if item.location else None,
|
||||
})
|
||||
data.update(
|
||||
{
|
||||
"city": item.location.city if item.location else None,
|
||||
"state": item.location.state if item.location else None,
|
||||
}
|
||||
)
|
||||
elif type_ == "ride":
|
||||
data.update({
|
||||
"park_name": item.park.name,
|
||||
"park_slug": item.park.slug
|
||||
})
|
||||
data.update({"park_name": item.park.name, "park_slug": item.park.slug})
|
||||
results.append(data)
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user