Skip to content

Commit

Permalink
Merge pull request #1510 from senid231/fix-admin-cdr-api-relationships
Browse files Browse the repository at this point in the history
fix admin cdr api relationships
  • Loading branch information
dmitry-sinina authored Jul 18, 2024
2 parents d80346a + 3c905fd commit 2ddf250
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions config/initializers/jsonapi_resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ def resource_for(type)
JSONAPI::Resource.register_resource_override 'api/rest/admin/billing', 'Account', 'Api::Rest::Admin::Account'
JSONAPI::Resource.register_resource_override 'api/rest/admin/billing', 'Country', 'Api::Rest::Admin::System::Country'
JSONAPI::Resource.register_resource_override 'api/rest/admin/billing', 'Network', 'Api::Rest::Admin::System::Network'

JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Dialpeer', 'Api::Rest::Admin::Dialpeer'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Pop', 'Api::Rest::Admin::Pop'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'CustomersAuth', 'Api::Rest::Admin::CustomersAuth'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Contractor', 'Api::Rest::Admin::Contractor'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Account', 'Api::Rest::Admin::Account'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Gateway', 'Api::Rest::Admin::Gateway'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'RoutingPlan', 'Api::Rest::Admin::RoutingPlan'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Country', 'Api::Rest::Admin::System::Country'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Network', 'Api::Rest::Admin::System::Network'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Rateplan', 'Api::Rest::Admin::Routing::Rateplan'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'RoutingGroup', 'Api::Rest::Admin::Routing::RoutingGroup'
JSONAPI::Resource.register_resource_override 'api/rest/admin/cdr', 'Destination', 'Api::Rest::Admin::Routing::Destination'
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def dasherized_resources(name, options = {}, &block)
namespace :cdr do
jsonapi_resources :cdrs, only: %i[index show] do
member { get :recording }
jsonapi_relationships
end
jsonapi_resources :auth_logs, only: %i[index show] do
end
Expand Down

0 comments on commit 2ddf250

Please sign in to comment.