0
0
Fork 0

Clean up for api/base controller (#3629)

* Move ApiController to Api/BaseController

* API controllers inherit from Api::BaseController

* Add coverage for various error cases in api/base controller
This commit is contained in:
Matt Jankowski 2017-06-07 14:09:25 -04:00 committed by Eugen Rochko
parent 92bb166246
commit 73540ffe6b
35 changed files with 87 additions and 54 deletions

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
class Api::V1::Timelines::HomeController < ApiController
class Api::V1::Timelines::HomeController < Api::BaseController
before_action -> { doorkeeper_authorize! :read }, only: [:show]
before_action :require_user!, only: [:show]
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
class Api::V1::Timelines::PublicController < ApiController
class Api::V1::Timelines::PublicController < Api::BaseController
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
respond_to :json

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
class Api::V1::Timelines::TagController < ApiController
class Api::V1::Timelines::TagController < Api::BaseController
before_action :load_tag
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }