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
Update to use platform API on admin.
Matthew Kennedyd2be50a70408
diff --git a/api/app/serializers/spree/api/v2/platform/taxon_serializer.rb b/api/app/serializers/spree/api/v2/platform/taxon_serializer.rbindex ac7ff4641f..e71a3e2649 100644--- a/api/app/serializers/spree/api/v2/platform/taxon_serializer.rb+++ b/api/app/serializers/spree/api/v2/platform/taxon_serializer.rb@@ -5,6 +5,20 @@ module Spreeclass TaxonSerializer < BaseSerializerinclude ::Spree::Api::V2::ResourceSerializerConcern+ attributes :pretty_name, :seo_title++ attribute :is_root do |taxon|+ taxon.root?+ end++ attribute :is_child do |taxon|+ taxon.child?+ end++ attribute :is_leaf do |taxon|+ taxon.leaf?+ end+belongs_to :parent, record_type: :taxon, serializer: :taxonbelongs_to :taxonomy, record_type: :taxonomydiff --git a/backend/app/assets/javascripts/spree/backend.js b/backend/app/assets/javascripts/spree/backend.jsindex a3bb76b0ba..cd294125ba 100644--- a/backend/app/assets/javascripts/spree/backend.js+++ b/backend/app/assets/javascripts/spree/backend.js@@ -96,12 +96,8 @@ Spree.routes.products_api_v2 = Spree.pathFor('/api/v2/platform/products')Spree.routes.users_api_v2 = Spree.pathFor('api/v2/platform/users')// TODO:-// Update this from storefont to platform.--// Using storefront due to issues with-// taxon platform api not returning the attribute :pretty_name-// and also returning all taxons, even when filtered by name.-Spree.routes.taxons_api_v2 = Spree.pathFor('/api/v2/storefront/taxons')+// taxon returning all taxons, even when filtered by name.+Spree.routes.taxons_api_v2 = Spree.pathFor('/api/v2/platform/taxons')Spree.apiV2Authentication = function() {return {diff --git a/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6 b/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6index fa799af4b9..f258ff4baf 100644--- a/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6+++ b/backend/app/assets/javascripts/spree/backend/global/select2_autocomplete.es6@@ -1,5 +1,5 @@// Allows you to use one autocomplete for sevral use cases with sensible defaults.-// Requires two params passing to work, the api V1 URI, and the data attribute -> data_attrbute_name: 'products'+// Requires two params passing to work, the api URI, and the data attribute -> data_attrbute_name: 'products'$.fn.select2Autocomplete = function(params) {// Required paramsconst apiUrl = params.apiUrl