Merge branch '240-pagination' into 'develop'
Resolve "50 results per page returns 25" Closes #240 See merge request funkwhale/funkwhale!218
This commit is contained in:
commit
877feff329
|
@ -3,4 +3,4 @@ from rest_framework.pagination import PageNumberPagination
|
||||||
|
|
||||||
class FunkwhalePagination(PageNumberPagination):
|
class FunkwhalePagination(PageNumberPagination):
|
||||||
page_size_query_param = 'page_size'
|
page_size_query_param = 'page_size'
|
||||||
max_page_size = 25
|
max_page_size = 50
|
||||||
|
|
|
@ -12,12 +12,6 @@ from . import models
|
||||||
from . import serializers
|
from . import serializers
|
||||||
|
|
||||||
|
|
||||||
class CustomLimitPagination(pagination.PageNumberPagination):
|
|
||||||
page_size = 100
|
|
||||||
page_size_query_param = 'page_size'
|
|
||||||
max_page_size = 100
|
|
||||||
|
|
||||||
|
|
||||||
class TrackFavoriteViewSet(mixins.CreateModelMixin,
|
class TrackFavoriteViewSet(mixins.CreateModelMixin,
|
||||||
mixins.DestroyModelMixin,
|
mixins.DestroyModelMixin,
|
||||||
mixins.ListModelMixin,
|
mixins.ListModelMixin,
|
||||||
|
@ -26,7 +20,6 @@ class TrackFavoriteViewSet(mixins.CreateModelMixin,
|
||||||
serializer_class = serializers.UserTrackFavoriteSerializer
|
serializer_class = serializers.UserTrackFavoriteSerializer
|
||||||
queryset = (models.TrackFavorite.objects.all())
|
queryset = (models.TrackFavorite.objects.all())
|
||||||
permission_classes = [ConditionalAuthentication]
|
permission_classes = [ConditionalAuthentication]
|
||||||
pagination_class = CustomLimitPagination
|
|
||||||
|
|
||||||
def create(self, request, *args, **kwargs):
|
def create(self, request, *args, **kwargs):
|
||||||
serializer = self.get_serializer(data=request.data)
|
serializer = self.get_serializer(data=request.data)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Fixed ignored page_size paremeter on artist and favorites list (#240)
|
|
@ -136,19 +136,15 @@ export default {
|
||||||
watch: {
|
watch: {
|
||||||
page: function () {
|
page: function () {
|
||||||
this.updateQueryString()
|
this.updateQueryString()
|
||||||
this.fetchFavorites(FAVORITES_URL)
|
|
||||||
},
|
},
|
||||||
paginateBy: function () {
|
paginateBy: function () {
|
||||||
this.updateQueryString()
|
this.updateQueryString()
|
||||||
this.fetchFavorites(FAVORITES_URL)
|
|
||||||
},
|
},
|
||||||
orderingDirection: function () {
|
orderingDirection: function () {
|
||||||
this.updateQueryString()
|
this.updateQueryString()
|
||||||
this.fetchFavorites(FAVORITES_URL)
|
|
||||||
},
|
},
|
||||||
ordering: function () {
|
ordering: function () {
|
||||||
this.updateQueryString()
|
this.updateQueryString()
|
||||||
this.fetchFavorites(FAVORITES_URL)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue