diff --git a/app/controllers/api/osuny/application_controller.rb b/app/controllers/api/osuny/application_controller.rb index c193591538c4446c84171f103a7e63dd8e6e1f81..5f3111aecfbca56e4eeb7d5fc8a2f7ed3899c2b4 100644 --- a/app/controllers/api/osuny/application_controller.rb +++ b/app/controllers/api/osuny/application_controller.rb @@ -7,8 +7,4 @@ class Api::Osuny::ApplicationController < Api::ApplicationController raise_403_unless @app end - def website - @website ||= current_university.websites.find params[:website_id] - end - end \ No newline at end of file diff --git a/app/controllers/api/osuny/communication/websites/application_controller.rb b/app/controllers/api/osuny/communication/websites/application_controller.rb index 3df30d5485d10e89e23f64a2a0b0d554b782120c..c90b5342523f93584d5ed8ed65a63e311317f414 100644 --- a/app/controllers/api/osuny/communication/websites/application_controller.rb +++ b/app/controllers/api/osuny/communication/websites/application_controller.rb @@ -1,11 +1,9 @@ class Api::Osuny::Communication::Websites::ApplicationController < Api::Osuny::ApplicationController - skip_before_action :verify_authenticity_token, only: :import - before_action :verify_app_token, only: :import - def import - Importers::Api::Osuny::Communication::Website::Page.new university: current_university, - website: website, - params: params[:page] - render json: :ok + protected + + def website + @website ||= current_university.websites.find params[:website_id] end + end diff --git a/app/controllers/api/osuny/communication/websites/pages_controller.rb b/app/controllers/api/osuny/communication/websites/pages_controller.rb index f8ab5c3209ae02d769045f281bf0011cededaf86..ec16240c53da100e2253e9bbede77f1b8c3d6331 100644 --- a/app/controllers/api/osuny/communication/websites/pages_controller.rb +++ b/app/controllers/api/osuny/communication/websites/pages_controller.rb @@ -1,4 +1,4 @@ -class Api::Osuny::Communication::Websites::PagesController < Api::Osuny::ApplicationController +class Api::Osuny::Communication::Websites::PagesController < Api::Osuny::Communication::Websites::ApplicationController skip_before_action :verify_authenticity_token, only: :import before_action :verify_app_token, only: :import diff --git a/app/controllers/api/osuny/communication/websites/posts_controller.rb b/app/controllers/api/osuny/communication/websites/posts_controller.rb index cc0f67ea7ae47f3917bd2548e6d0e59a9167b0be..0b04dacf07e79575b872dec2b4dd66a9098cea34 100644 --- a/app/controllers/api/osuny/communication/websites/posts_controller.rb +++ b/app/controllers/api/osuny/communication/websites/posts_controller.rb @@ -1,4 +1,4 @@ -class Api::Osuny::Communication::Websites::PostsController < Api::Osuny::ApplicationController +class Api::Osuny::Communication::Websites::PostsController < Api::Osuny::Communication::Websites::ApplicationController skip_before_action :verify_authenticity_token, only: :import before_action :verify_app_token, only: :import