1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00

fix events pagniation

This commit is contained in:
Sylvain 2016-06-30 12:41:47 +02:00
parent e36df94f0f
commit 5a0bb86394
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ Application.Controllers.controller "EventsController", ["$scope", "$state", 'Eve
$scope.loadMoreEvents = ->
Event.query Object.assign({page: $scope.page}, $scope.filters), (data) ->
$scope.events = $scope.events.concat data
groupEvents(data)
groupEvents($scope.events)
$scope.page += 1
if (!data[0] || data[0].nb_total_events <= $scope.events.length)

View File

@ -1,4 +1,4 @@
total = @events.count
total = @events.except(:offset, :limit, :order).count
json.cache! [@events, @page] do
json.array!(@events) do |event|