Files

21 lines
733 B
Python

from pickle import BUILD
from playlist import serializers
from rest_framework.views import APIView
from rest_framework.response import Response
from playlist.serializers import ProfileSerializer, ProfileUpdateSerializer, BackgroundSerializer
from playlist.models import Profile, Background
from drf_spectacular.utils import extend_schema
@extend_schema(
summary="Get the current user's profile",
description="Retrieve the profile information of the currently authenticated user.",
responses={
200: ProfileSerializer,
},
)
class ProfileMeView(APIView):
def get(self, request):
profile = request.user.profile
serializer = ProfileSerializer(profile)
return Response(serializer.data)