diff --git a/app/controllers/api/v2/base_controller.rb b/app/controllers/api/v2/base_controller.rb index 4f62ebff798..d4456333ba1 100644 --- a/app/controllers/api/v2/base_controller.rb +++ b/app/controllers/api/v2/base_controller.rb @@ -102,8 +102,8 @@ def metadata_page end def metadata_per_page - @per_page ||= Setting[:entries_per_page] if params[:per_page].blank? - @per_page ||= params[:per_page] == 'all' ? metadata_total : params[:per_page].to_i + @per_page ||= Setting[:entries_per_page].to_i if params[:per_page].blank? + @per_page ||= params[:per_page] == 'all' ? metadata_total.to_i : params[:per_page].to_i end # For the purpose of ADDING/REMOVING associations in CHILD node on POST/PUT payload diff --git a/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/TableIndexPage.js b/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/TableIndexPage.js index 0c6b2db8a1d..e379712c383 100644 --- a/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/TableIndexPage.js +++ b/webpack/assets/javascripts/react_app/components/PF4/TableIndexPage/TableIndexPage.js @@ -141,14 +141,16 @@ const TableIndexPage = ({ can_create: canCreate, results, total, - per_page: perPage, - page, + per_page: respPerPage, + page: respPage, subtotal, message: errorMessage, }, status = STATUS.PENDING, setAPIOptions, } = response; + const page = Number(respPage); + const perPage = Number(respPerPage); const memoDefaultSearchProps = useMemo( () => getControllerSearchProps(controller),