вернул обычную схему в запрос для поиска избранных треков
This commit is contained in:
parent
9a4f11969f
commit
f24de374f8
|
|
@ -33,15 +33,10 @@ class SongViewSet(GenericViewSet):
|
|||
return Response(serializer.data)
|
||||
|
||||
|
||||
@action(
|
||||
detail=False,
|
||||
methods=['get'],
|
||||
url_path='check_is_favorite/(?P<azura_id>[a-zA-Z0-9_]+)',
|
||||
url_name='check_is_favorite',
|
||||
)
|
||||
@action(detail=False, methods=['GET'], schema=DeleteSongSchema())
|
||||
def check_is_favorite(self, request):
|
||||
try:
|
||||
song_obj = Song.objects.get(azura_id=request.data.get('azura_id'))
|
||||
song_obj = Song.objects.get(azura_id=request.data.get('song_id'))
|
||||
favorite_songs = FavoriteSong.objects.get(user=request.user, song=song_obj)
|
||||
except ObjectDoesNotExist:
|
||||
return Response({"error": 'Объекта не существует'}, status=status.HTTP_404_NOT_FOUND)
|
||||
|
|
|
|||
Loading…
Reference in New Issue