Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Say customer in the reporting vocabulary, not user

Damian Legawieca84909d67745
diff --git a/spree/core/lib/spree/reporting/default_vocabulary.rb b/spree/core/lib/spree/reporting/default_vocabulary.rb
index ec47bf0097..0c0a74d95b 100644
--- a/spree/core/lib/spree/reporting/default_vocabulary.rb
+++ b/spree/core/lib/spree/reporting/default_vocabulary.rb
@@ -63,10 +63,10 @@ module Spree
Spree::PrefixedId.prefixed_id?(value.to_s) ? Spree.customer_class.find_by_prefix_id!(value).email : value
},
hydrate: lambda { |store, emails, _params|
- users = store.customers.distinct.where(email: emails).index_by(&:email)
+ customers = store.customers.distinct.where(email: emails).index_by(&:email)
emails.to_h do |email|
- user = users[email]
- [email, { id: user&.prefixed_id, label: user&.full_name.presence || email, meta: { email: email } }]
+ customer = customers[email]
+ [email, { id: customer&.prefixed_id, label: customer&.full_name.presence || email, meta: { email: email } }]
end
}