class Osso::GraphQL::Mutations::DeleteEnterpriseAccount

Public Instance Methods

domain(**args) click to toggle source
# File lib/osso/graphql/mutations/delete_enterprise_account.rb, line 29
def domain(**args)
  enterprise_account(**args).domain
end
enterprise_account(id:, **_args) click to toggle source
# File lib/osso/graphql/mutations/delete_enterprise_account.rb, line 14
def enterprise_account(id:, **_args)
  @enterprise_account ||= Osso::Models::EnterpriseAccount.find(id)
end
resolve(**args) click to toggle source
# File lib/osso/graphql/mutations/delete_enterprise_account.rb, line 18
def resolve(**args)
  customer = enterprise_account(**args)

  if customer.destroy
    Osso::Analytics.capture(email: context[:email], event: self.class.name.demodulize, properties: args)
    return response_data(enterprise_account: nil)
  end

  response_error(customer.errors)
end