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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Reduce N+1 queries in Admin Panel
Damian Legawiecdfc028e5eea2
diff --git a/backend/app/controllers/spree/admin/products_controller.rb b/backend/app/controllers/spree/admin/products_controller.rbindex 3449493229..d4bbe485c7 100644--- a/backend/app/controllers/spree/admin/products_controller.rb+++ b/backend/app/controllers/spree/admin/products_controller.rb@@ -151,7 +151,12 @@ module Spreeenddef product_includes- [{ variants: [:images], master: [:images, :default_price] }]+ {+ variant_images: [],+ tax_category: [],+ master: [],+ variants: [:prices]+ }enddef clone_object_url(resource)diff --git a/backend/app/controllers/spree/admin/store_credits_controller.rb b/backend/app/controllers/spree/admin/store_credits_controller.rbindex f6291237ce..6041ef1417 100644--- a/backend/app/controllers/spree/admin/store_credits_controller.rb+++ b/backend/app/controllers/spree/admin/store_credits_controller.rb@@ -9,7 +9,7 @@ module Spreebefore_action :ensure_unused_store_credit, only: [:update]def index- @store_credits = @user.store_credits.for_store(current_store).includes(:credit_type, :category).reverse_order+ @store_credits = @user.store_credits.for_store(current_store).includes(:category).reverse_orderenddef create