added object count to my_products
This commit is contained in:
@@ -68,7 +68,11 @@ def my_products(request):
|
||||
elif limit is not None:
|
||||
limit = int(limit)
|
||||
data = data[:limit]
|
||||
return Response(data=data)
|
||||
# prepare response payload
|
||||
payload = {}
|
||||
payload['results'] = data
|
||||
payload['count'] = len(payload['results'])
|
||||
return Response(data=payload)
|
||||
|
||||
|
||||
@api_view(['POST',])
|
||||
|
||||
Reference in New Issue
Block a user