diff --git a/app/controllers/api/v2/tokens_controller.rb b/app/controllers/api/v2/tokens_controller.rb index 1170945f..e0474e25 100644 --- a/app/controllers/api/v2/tokens_controller.rb +++ b/app/controllers/api/v2/tokens_controller.rb @@ -18,12 +18,6 @@ module Api create_action respond_with_resource end - - def my_tokens - authorize resource_class - instantiate_collection - respond_with_collection - end end end end diff --git a/config/routes.rb b/config/routes.rb index b5078d86..79db8599 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -70,9 +70,7 @@ Metamaps::Application.routes.draw do delete :stars, to: 'stars#destroy', on: :member end resources :synapses, only: [:index, :create, :show, :update, :destroy] - resources :tokens, only: [:create, :destroy] do - get :my_tokens, on: :collection - end + resources :tokens, only: [:index, :create, :destroy] resources :topics, only: [:index, :create, :show, :update, :destroy] resources :users, only: [:index, :show] do get :current, on: :collection diff --git a/doc/api/apis/tokens.raml b/doc/api/apis/tokens.raml index ef7a8379..5d4eb191 100644 --- a/doc/api/apis/tokens.raml +++ b/doc/api/apis/tokens.raml @@ -1,4 +1,13 @@ #type: collection +get: + description: | + A list of the current user's tokens. + is: [ searchable: { searchFields: description }, pageable, orderable ] + responses: + 200: + body: + application/json: + example: !include ../examples/tokens.json post: body: application/json: @@ -11,14 +20,6 @@ post: body: application/json: example: !include ../examples/token.json -/my_tokens: - get: - is: [ searchable: { searchFields: description }, pageable, orderable ] - responses: - 200: - body: - application/json: - example: !include ../examples/tokens.json /{id}: #type: item delete: