diff options
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/api/v1/chouette_controller.rb | 5 | ||||
| -rw-r--r-- | app/controllers/api/v1/workbenches_controller.rb | 3 | ||||
| -rw-r--r-- | app/controllers/api_keys_controller.rb | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/app/controllers/api/v1/chouette_controller.rb b/app/controllers/api/v1/chouette_controller.rb index 7805074ee..98c2fff05 100644 --- a/app/controllers/api/v1/chouette_controller.rb +++ b/app/controllers/api/v1/chouette_controller.rb @@ -7,7 +7,6 @@ module Api before_action :authenticate private - def authenticate authenticate_or_request_with_http_token do |token, options| @referential = Api::V1::ApiKey.referential_from_token(token) @@ -16,10 +15,10 @@ module Api switch_referential if @api_key end end + def switch_referential Apartment::Tenant.switch!(@api_key.referential.slug) - end - + end end end end diff --git a/app/controllers/api/v1/workbenches_controller.rb b/app/controllers/api/v1/workbenches_controller.rb new file mode 100644 index 000000000..3c07997ce --- /dev/null +++ b/app/controllers/api/v1/workbenches_controller.rb @@ -0,0 +1,3 @@ +class Api::V1::WorkbenchesController < Api::V1::IbooController + defaults :resource_class => Workbench +end diff --git a/app/controllers/api_keys_controller.rb b/app/controllers/api_keys_controller.rb index bd225818b..7059cf52e 100644 --- a/app/controllers/api_keys_controller.rb +++ b/app/controllers/api_keys_controller.rb @@ -3,7 +3,7 @@ class ApiKeysController < BreadcrumbController def create @api_key = Api::V1::ApiKey.new(api_key_params.merge(organisation: current_organisation)) - create! { organisation_api_key_path(resource) } + create! { organisation_api_keys_path } end def index |
