Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit c2ef169

Browse files
committed
Reorder service route bindings controller methods
The order now matches the pattern in other endpoints
1 parent a54e49e commit c2ef169

2 files changed

Lines changed: 267 additions & 267 deletions

File tree

app/controllers/v3/service_route_bindings_controller.rb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,28 @@
1515
class ServiceRouteBindingsController < ApplicationController
1616
before_action :set_route_binding, only: [:show, :parameters, :destroy]
1717

18+
def index
19+
message = list_message
20+
route_bindings = fetch_route_bindings(message)
21+
render status: :ok, json: Presenters::V3::PaginatedListPresenter.new(
22+
presenter: Presenters::V3::ServiceRouteBindingPresenter,
23+
paginated_result: SequelPaginator.new.get_page(route_bindings, message.try(:pagination_options)),
24+
path: '/v3/service_route_bindings',
25+
message: message,
26+
decorators: decorators(message)
27+
)
28+
end
29+
30+
def show
31+
message = show_message
32+
route_binding_not_found! unless @route_binding && can_read_space?(@route_binding.route.space)
33+
presenter = Presenters::V3::ServiceRouteBindingPresenter.new(
34+
@route_binding,
35+
decorators: decorators(message)
36+
)
37+
render status: :ok, json: presenter
38+
end
39+
1840
def create
1941
route_services_disabled! unless route_services_enabled?
2042
message = parse_create_request
@@ -40,28 +62,6 @@ def create
4062
already_exists!
4163
end
4264

43-
def show
44-
message = show_message
45-
route_binding_not_found! unless @route_binding && can_read_space?(@route_binding.route.space)
46-
presenter = Presenters::V3::ServiceRouteBindingPresenter.new(
47-
@route_binding,
48-
decorators: decorators(message)
49-
)
50-
render status: :ok, json: presenter
51-
end
52-
53-
def index
54-
message = list_message
55-
route_bindings = fetch_route_bindings(message)
56-
render status: :ok, json: Presenters::V3::PaginatedListPresenter.new(
57-
presenter: Presenters::V3::ServiceRouteBindingPresenter,
58-
paginated_result: SequelPaginator.new.get_page(route_bindings, message.try(:pagination_options)),
59-
path: '/v3/service_route_bindings',
60-
message: message,
61-
decorators: decorators(message)
62-
)
63-
end
64-
6565
def destroy
6666
route_binding_not_found! unless @route_binding && can_read_space?(@route_binding.route.space)
6767

0 commit comments

Comments
 (0)