Запрос на бек, поправить логику
This commit is contained in:
1 parent
9550a5ff10
commit
f75fe88d1b
3 files changed
+45
-11
No files matched your search
@@ -7,6 +7,7 @@ urlpatterns = [
|
||||
|
||||
path('links/', LinkAPIView.as_view(), name='LinkAPIView'),
|
||||
path('news/', NewsAPIView.as_view(), name='NewsAPIView'),
|
||||
path('gallery/', GalleryAPIView.as_view(), name='GalleryAPIView'),
|
||||
path('carousels/', CarouselsAPIView.as_view(), name='CarouselsAPIView'),
|
||||
path('ckeditor/', include('ckeditor_uploader.urls'))
|
||||
|
||||
|
||||
@@ -24,6 +24,14 @@ class LinkAPIView(ListAPIView):
|
||||
return Response(serializer.data)
|
||||
|
||||
|
||||
class GalleryAPIView(ListAPIView):
|
||||
def get(self, request):
|
||||
|
||||
gal = Gallery.objects.filter(id=int(request.GET.get('id')))
|
||||
result = GallerySerializer(gal, many=True).data
|
||||
|
||||
return Response(result)
|
||||
|
||||
class NewsAPIView(ListAPIView):
|
||||
permission_classes = (AllowAny,)
|
||||
|
||||
|
||||
Reference in new issue
Block a user