Sha256: d9fabeb5340eb7e3a4d688223575d547b3e6e5b4d1b5cb05d411373e959ddd02

Contents?: true

Size: 745 Bytes

Versions: 11

Compression:

Stored size: 745 Bytes

Contents

require "shopify_cli"

module Node
  module Commands
    class Populate
      class Customer < ShopifyCli::AdminAPI::PopulateResourceCommand
        @input_type = :CustomerInput

        def defaults
          first_name, last_name = ShopifyCli::Helpers::Haikunator.name
          {
            firstName: first_name,
            lastName: last_name,
          }
        end

        def message(data)
          ret = data["customerCreate"]["customer"]
          id = ShopifyCli::API.gid_to_id(ret["id"])
          @ctx.message(
            "node.populate.customer.added",
            ret["displayName"],
            ShopifyCli::Project.current.env.shop,
            admin_url,
            id
          )
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.13.1 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.13.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.12.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.11.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.10.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.9.1 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.9.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.8.0 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.7.1 lib/project_types/node/commands/populate/customer.rb
shopify-cli-1.7.0 lib/project_types/node/commands/populate/customer.rb