diff options
author | Reverite <github@reverite.sh> | 2019-11-21 21:52:48 -0500 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-11-21 21:52:48 -0500 |
commit | 37a9551c3fe59dd1f50a363ce2532c5f00fdf228 (patch) | |
tree | c3972adfaaf33034bd9efd069881a2090f35e912 /app/controllers | |
parent | b2c43eeece54980657875b29507e503531b010de (diff) | |
parent | 55f5e81a9dc4c6cede5d43e549061be2ea9be614 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api/v1/accounts/credentials_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/api/v1/bookmarks_controller.rb | 13 | ||||
-rw-r--r-- | app/controllers/application_controller.rb | 10 |
3 files changed, 7 insertions, 18 deletions
diff --git a/app/controllers/api/v1/accounts/credentials_controller.rb b/app/controllers/api/v1/accounts/credentials_controller.rb index e77f57910..64b5cb747 100644 --- a/app/controllers/api/v1/accounts/credentials_controller.rb +++ b/app/controllers/api/v1/accounts/credentials_controller.rb @@ -25,7 +25,7 @@ class Api::V1::Accounts::CredentialsController < Api::BaseController end def user_settings_params - return nil unless params.key?(:source) + return nil if params[:source].blank? source_params = params.require(:source) diff --git a/app/controllers/api/v1/bookmarks_controller.rb b/app/controllers/api/v1/bookmarks_controller.rb index 1cab3c372..e1b244e76 100644 --- a/app/controllers/api/v1/bookmarks_controller.rb +++ b/app/controllers/api/v1/bookmarks_controller.rb @@ -26,10 +26,9 @@ class Api::V1::BookmarksController < Api::BaseController end def results - @_results ||= account_bookmarks.paginate_by_max_id( + @_results ||= account_bookmarks.paginate_by_id( limit_param(DEFAULT_STATUSES_LIMIT), - params[:max_id], - params[:since_id] + params_slice(:max_id, :since_id, :min_id) ) end @@ -42,15 +41,11 @@ class Api::V1::BookmarksController < Api::BaseController end def next_path - if records_continue? - api_v1_bookmarks_url pagination_params(max_id: pagination_max_id) - end + api_v1_bookmarks_url pagination_params(max_id: pagination_max_id) if records_continue? end def prev_path - unless results.empty? - api_v1_bookmarks_url pagination_params(since_id: pagination_since_id) - end + api_v1_bookmarks_url pagination_params(min_id: pagination_since_id) unless results.empty? end def pagination_max_id diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 92339ce2f..599c64062 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -211,13 +211,7 @@ class ApplicationController < ActionController::Base end def respond_with_error(code) - respond_to do |format| - format.any { head code } - - format.html do - use_pack 'error' - render "errors/#{code}", layout: 'error', status: code - end - end + use_pack 'error' + render "errors/#{code}", layout: 'error', status: code end end |