remove unnecessary api v1 code
This commit is contained in:
parent
2c64b67abd
commit
9513087bbd
7 changed files with 6 additions and 49 deletions
|
@ -2,11 +2,11 @@
|
||||||
module Api
|
module Api
|
||||||
module V1
|
module V1
|
||||||
class DeprecatedController < ApplicationController
|
class DeprecatedController < ApplicationController
|
||||||
# rubocop:disable Style/MethodMissing
|
def deprecated
|
||||||
def method_missing
|
render json: {
|
||||||
render json: { error: '/api/v1 is deprecated! Please use /api/v2 instead.' }, status: :gone
|
error: '/api/v1 has been deprecated! Please use /api/v2 instead.'
|
||||||
end
|
}, status: :gone
|
||||||
# rubocop:enable Style/MethodMissing
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module Api
|
|
||||||
module V1
|
|
||||||
class MappingsController < DeprecatedController
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,7 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module Api
|
|
||||||
module V1
|
|
||||||
class MapsController < DeprecatedController
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,7 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module Api
|
|
||||||
module V1
|
|
||||||
class SynapsesController < DeprecatedController
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,7 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module Api
|
|
||||||
module V1
|
|
||||||
class TokensController < DeprecatedController
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,7 +0,0 @@
|
||||||
# frozen_string_literal: true
|
|
||||||
module Api
|
|
||||||
module V1
|
|
||||||
class TopicsController < DeprecatedController
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -80,16 +80,8 @@ Metamaps::Application.routes.draw do
|
||||||
match '*path', to: 'restful#catch_404', via: :all
|
match '*path', to: 'restful#catch_404', via: :all
|
||||||
end
|
end
|
||||||
namespace :v1, path: '/v1' do
|
namespace :v1, path: '/v1' do
|
||||||
# api v1 routes all lead to a deprecation error method
|
root to: 'deprecated#deprecated', via: :all
|
||||||
# see app/controllers/api/v1/deprecated_controller.rb
|
match '*path', to: 'deprecated#deprecated', via: :all
|
||||||
resources :maps, only: [:create, :show, :update, :destroy]
|
|
||||||
resources :synapses, only: [:create, :show, :update, :destroy]
|
|
||||||
resources :topics, only: [:create, :show, :update, :destroy]
|
|
||||||
resources :mappings, only: [:create, :show, :update, :destroy]
|
|
||||||
resources :tokens, only: [:create, :destroy] do
|
|
||||||
get :my_tokens, on: :collection
|
|
||||||
end
|
|
||||||
match '*path', to: 'deprecated#method_missing', via: :all
|
|
||||||
end
|
end
|
||||||
match '*path', to: 'v2/restful#catch_404', via: :all
|
match '*path', to: 'v2/restful#catch_404', via: :all
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue