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
Fixed Platform API Taxon Image serializer
Damian Legawiec5e1bce387742
diff --git a/api/app/serializers/spree/api/v2/platform/taxon_image_serializer.rb b/api/app/serializers/spree/api/v2/platform/taxon_image_serializer.rbindex 42f907f89e..664a4f34a3 100644--- a/api/app/serializers/spree/api/v2/platform/taxon_image_serializer.rb+++ b/api/app/serializers/spree/api/v2/platform/taxon_image_serializer.rb@@ -3,7 +3,9 @@ module Spreemodule V2module Platformclass TaxonImageSerializer < BaseSerializer- include ::Spree::Api::V2::ResourceSerializerConcern+ set_type :taxon_image++ attributes :styles, :alt, :created_at, :updated_atendendenddiff --git a/api/spec/serializers/spree/api/v2/platform/taxon_image_serializer_spec.rb b/api/spec/serializers/spree/api/v2/platform/taxon_image_serializer_spec.rbindex ba93a8de91..ba7a7e0dbc 100644--- a/api/spec/serializers/spree/api/v2/platform/taxon_image_serializer_spec.rb+++ b/api/spec/serializers/spree/api/v2/platform/taxon_image_serializer_spec.rb@@ -1,9 +1,9 @@require 'spec_helper'describe Spree::Api::V2::Platform::TaxonImageSerializer do- subject { described_class.new(taxon_image) }+ subject { described_class.new(image) }- let(:taxon_image) { create(:taxon_image) }+ let(:image) { create(:taxon_image) }it { expect(subject.serializable_hash).to be_kind_of(Hash) }@@ -11,20 +11,13 @@ describe Spree::Api::V2::Platform::TaxonImageSerializer doexpect(subject.serializable_hash).to eq({data: {- id: taxon_image.id.to_s,+ id: image.id.to_s,type: :taxon_image,attributes: {- viewable_type: taxon_image.viewable_type,- attachment_height: taxon_image.attachment_height,- attachment_file_size: taxon_image.attachment_file_size,- position: taxon_image.position,- attachment_content_type: taxon_image.attachment_content_type,- attachment_file_name: taxon_image.attachment_file_name,- type: taxon_image.type,- attachment_updated_at: taxon_image.attachment_updated_at,- alt: taxon_image.alt,- created_at: taxon_image.created_at,- updated_at: taxon_image.updated_at+ styles: image.styles,+ alt: image.alt,+ created_at: image.created_at,+ updated_at: image.updated_at},}}