diff --git a/app/controllers/apps_controller.rb b/app/controllers/apps_controller.rb index e8be990a3d..cad014243f 100644 --- a/app/controllers/apps_controller.rb +++ b/app/controllers/apps_controller.rb @@ -7,20 +7,20 @@ class AppsController < ApplicationController folder_id = params[:folder] if folder_id.blank? - @apps = App.where(organization: @current_user.organization) + @scope = App.where(organization: @current_user.organization) else @folder = Folder.find folder_id - @apps = @folder.apps + @scope = @folder.apps end - @apps = @apps.order('created_at desc') + @apps = @scope.order('created_at desc') .page(params[:page]) .per(10) .includes(:user) @meta = { total_pages: @apps.total_pages, - count: App.count, + count: @scope.count, current_page: @apps.current_page } end diff --git a/frontend/src/_components/Pagination.jsx b/frontend/src/_components/Pagination.jsx index 4fa0a841fc..b5e3239e0a 100644 --- a/frontend/src/_components/Pagination.jsx +++ b/frontend/src/_components/Pagination.jsx @@ -3,37 +3,36 @@ import React from 'react'; export const Pagination = function Pagination({ currentPage, count, totalPages, pageChanged }) { + function renderPageItem(i) { + return
Showing { (currentPage - 1) * 10 + 1} to {currentPage * 10} of {count} entries
+ return (Showing { (currentPage - 1) * 10 + 1} to {currentPage * 10} of {count}
-