aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/api
diff options
context:
space:
mode:
authorXinhui2017-08-22 12:49:55 +0200
committerXinhui2017-08-22 14:52:49 +0200
commit9a281154ea20a6450bb53880f1dd77d5139075f1 (patch)
treea9dd7c08bd500ed0f9238c0b1c5038d9cef22ec9 /app/controllers/api
parent49eeb2919090f26f5d16d446df6f5890fc71625a (diff)
downloadchouette-core-9a281154ea20a6450bb53880f1dd77d5139075f1.tar.bz2
API - new end point for workbenches
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/chouette_controller.rb5
-rw-r--r--app/controllers/api/v1/workbenches_controller.rb3
2 files changed, 5 insertions, 3 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