From 3c905fdf31c1cbfda98539dca035648aa253608d Mon Sep 17 00:00:00 2001 From: Denis Talakevich Date: Thu, 18 Jul 2024 17:47:50 +0300 Subject: [PATCH] fix admin cdr api relationships --- config/initializers/jsonapi_resources.rb | 13 +++++++++++++ config/routes.rb | 1 + 2 files changed, 14 insertions(+) diff --git a/config/initializers/jsonapi_resources.rb b/config/initializers/jsonapi_resources.rb index ad957dcb5..8c06e64cd 100644 --- a/config/initializers/jsonapi_resources.rb +++ b/config/initializers/jsonapi_resources.rb @@ -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' diff --git a/config/routes.rb b/config/routes.rb index 2c291a471..8bac0bf3f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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