mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-06 05:19:56 +02:00
Use our new event system for track favorites
This commit is contained in:
parent
dd5881f2c6
commit
e490284511
5 changed files with 85 additions and 1 deletions
|
@ -4,6 +4,7 @@ from rest_framework.response import Response
|
|||
from rest_framework import pagination
|
||||
from rest_framework.decorators import list_route
|
||||
|
||||
from funkwhale_api.activity import record
|
||||
from funkwhale_api.music.models import Track
|
||||
from funkwhale_api.common.permissions import ConditionalAuthentication
|
||||
|
||||
|
@ -33,6 +34,7 @@ class TrackFavoriteViewSet(mixins.CreateModelMixin,
|
|||
instance = self.perform_create(serializer)
|
||||
serializer = self.get_serializer(instance=instance)
|
||||
headers = self.get_success_headers(serializer.data)
|
||||
record.send(instance)
|
||||
return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
|
||||
|
||||
def get_queryset(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue