Class: Extension::Tasks::GetExtensions

Inherits:
ShopifyCLI::Task show all
Defined in:
lib/project_types/extension/tasks/get_extensions.rb

Instance Method Summary collapse

Instance Method Details

#call(context:, type:) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/project_types/extension/tasks/get_extensions.rb', line 7

def call(context:, type:)
  org_id = ShopifyCLI::DB.get(:organization_id)
  return [] unless org_id

  organization = ShopifyCLI::PartnersAPI::Organizations.fetch_with_extensions(context, type, id: org_id)
  return [] unless organization_with_apps?(organization)
  extensions_owned_by_organization(organization, context: context)
end