summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/v1/licenses_controller.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/controllers/v1/licenses_controller.rb b/app/controllers/v1/licenses_controller.rb
index 86eb85e..e919663 100644
--- a/app/controllers/v1/licenses_controller.rb
+++ b/app/controllers/v1/licenses_controller.rb
@@ -1,8 +1,10 @@
class V1::LicensesController < ApplicationController
+ PER_PAGE = 10
+ DEFAULT_PAGE = 1
+
def index
- per_page = 10
- page = 1
- @licenses = License.most_recent(page, per_page)
+ page = params[:page].to_i || DEFAULT_PAGE
+ @licenses = License.most_recent(page, PER_PAGE)
render nothing: true
end
end