docbrown/app/controllers/api/v0/articles_controller.rb
Fernando Valverde 8c836430ca
API V1 transition (#17835)
* API Articles v0-v1 restructure

* Remove unused helper

* Bulk move API controllers into concerns + add V1 controllers

* Extract API routes + some fixes

* Fix v1 api_controller authenticate! + add more article_controller specs

* Completed spec/requests/api/v1/articles_spec.rb

* specs up to listings

* All v1 specs except for 9 skips

* mime_types cleanup + authenticate! relocation

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2022-06-23 14:26:00 -06:00

19 lines
677 B
Ruby

module Api
module V0
# @note This controller partially authorizes with the ArticlePolicy, in an ideal world, it would
# fully authorize. However, that refactor would require significantly more work.
class ArticlesController < ApiController
include Api::ArticlesController
before_action :authenticate!, only: %i[create update me]
before_action :validate_article_param_is_hash, only: %i[create update]
before_action :set_cache_control_headers, only: %i[index show show_by_slug]
skip_before_action :verify_authenticity_token, only: %i[create update]
after_action :verify_authorized, only: %i[create]
end
end
end