Sha256: 43f4101faf085e88dca1051d91195d719ef358ee4c0caf1a0828d8f66e802d0d

Contents?: true

Size: 1.22 KB

Versions: 6

Compression:

Stored size: 1.22 KB

Contents

module Spree
  module Api
    module V2
      module Storefront
        module Account
          class CreditCardsController < ::Spree::Api::V2::ResourceController
            before_action :require_spree_current_user

            private

            def model_class
              Spree::CreditCard
            end

            def scope
              super.where(user: spree_current_user)
            end

            def collection_serializer
              Spree::Api::Dependencies.storefront_credit_card_serializer.constantize
            end

            def collection_finder
              Spree::Api::Dependencies.storefront_credit_card_finder.constantize
            end

            def resource_serializer
              Spree::Api::Dependencies.storefront_credit_card_serializer.constantize
            end

            def resource_finder
              Spree::Api::Dependencies.storefront_credit_card_finder.constantize
            end

            def serialize_collection(collection)
              collection_serializer.new(
                collection,
                include: resource_includes,
                fields: sparse_fields
              ).serializable_hash
            end
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_api-4.2.7 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb
spree_api-4.2.6 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb
spree_api-4.2.5 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb
spree_api-4.2.4 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb
spree_api-4.2.3.1 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb
spree_api-4.2.3 app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb