mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 22:19:16 +02:00
See #170: include subscriptions count in channels API
This commit is contained in:
parent
46d77cec2d
commit
3674d1235d
4 changed files with 27 additions and 1 deletions
|
@ -92,6 +92,11 @@ class ChannelViewSet(
|
|||
request.user.actor.emitted_follows.filter(target=object.actor).delete()
|
||||
return response.Response(status=204)
|
||||
|
||||
def get_serializer_context(self):
|
||||
context = super().get_serializer_context()
|
||||
context["subscriptions_count"] = self.action in ["retrieve", "create", "update"]
|
||||
return context
|
||||
|
||||
|
||||
class SubscriptionsViewSet(
|
||||
ChannelsMixin,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue