Added jwt, swagger...

This commit is contained in:
maciejrusek
2026-03-11 23:20:03 +01:00
parent f84c708f0a
commit ca605ac59d
14 changed files with 83 additions and 7 deletions

View File

@@ -3,7 +3,17 @@ from django.shortcuts import render
from apps.shelves.models import Shelf
from apps.shelves.serializers import ShelfSerializer
from rest_framework import viewsets
from rest_framework.permissions import IsAuthenticated
from rest_framework_simplejwt.authentication import JWTAuthentication
class ShelvesViewSet(viewsets.ModelViewSet):
queryset = Shelf.objects.select_related("user")
serializer_class = ShelfSerializer
serializer_class = ShelfSerializer
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]
def get_queryset(self):
return Shelf.objects.filter(user_id=self.request.user.pk)