Skip to content

Commit

Permalink
Refactor SchoolSuggestions into a global controller
Browse files Browse the repository at this point in the history
school.js needs to point to /school_suggestions and the route needs to
be in the global route file not in claims or placements domain
  • Loading branch information
CatalinVoineag committed Jan 5, 2024
1 parent 008c398 commit d1f01d9
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 18 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Claims::Support::SchoolSuggestionsController < ApplicationController
class SchoolSuggestionsController < ApplicationController
def index
render json: GiasSchool.search_name_urn_postcode(query_params)
end
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/school.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const onConfirm = (input) => (option) =>

function init() {
const options = {
path: `/support/school_suggestions`,
path: `/school_suggestions`,
template: {
inputValue: providerTemplate,
suggestion: providerSuggestionTemplate,
Expand Down
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
end

resources :service_updates, only: %i[index]
resources :school_suggestions, only: [:index]

draw :placements
draw :claims
Expand Down
1 change: 0 additions & 1 deletion config/routes/claims.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
resources :claims
resources :users, only: [:index]
end
resources :school_suggestions, only: [:index]
end
end
2 changes: 0 additions & 2 deletions config/routes/placements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
resources :schools, expect: %i[edit update] do
collection { get :check }
end
resources :school_suggestions, only: [:index]

resources :providers, expect: %i[edit update] do
collection { get :check }
end
Expand Down

0 comments on commit d1f01d9

Please sign in to comment.