Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The org-id is implicitly set by setting the scc-account-id. #126

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/controllers/api/v2/scc_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ def index

api :GET, '/scc_accounts/:id/', N_('Show scc_account')
param :id, :identifier_dottable, :required => true
param :organization_id, :identifier, :required => true
def show; end

def_param_group :scc_account do
param :scc_account, Hash, :required => true, :action_aware => true do
param :organization_id, :identifier, :required => true
param :name, String, :required => true, :desc => N_('Name of the scc_account')
param :login, String, :required => true, :desc => N_('Login id of scc_account')
param :password, String, :required => true, :desc => N_('Password of scc_account')
Expand All @@ -49,6 +47,7 @@ def show; end

api :POST, '/scc_accounts/', N_('Create an scc_account')
param_group :scc_account, :as => :create
param :organization_id, :identifier, :required => true
def create
@scc_account = resource_class.new(scc_account_params)
process_response @scc_account.save_with_logic!
Expand Down
1 change: 0 additions & 1 deletion app/controllers/api/v2/scc_products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def metadata_subtotal
def index
scope = resource_scope
scope = scope.where.not(:product_id => nil) if ::Foreman::Cast.to_bool(params[:subscribed_only])
scope = scope.where(:organization => params[:organization_id]) if params[:organization_id].present?
@scc_products = scope.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page])
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/api/v2/scc_products/main.json.rabl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

object @scc_product
extends 'api/v2/scc_products/base'
attributes :organization_id, :organization_name, :scc_account_id, :name, :arch, :friendly_name, :description, :product_id
attributes :scc_account_id, :name, :arch, :friendly_name, :description, :product_id
Loading