Sha256: dd2482678386c751f1bc36c0fae9f530f0f8cb9263db7943ba56ffbca549abea
Contents?: true
Size: 1.38 KB
Versions: 38
Compression:
Stored size: 1.38 KB
Contents
module Spree module Api module V2 module Storefront module Account class CreditCardsController < ::Spree::Api::V2::BaseController before_action :require_spree_current_user def index render_serialized_payload { serialize_collection(resource) } end def show render_serialized_payload { serialize_resource(resource) } end private def resource resource_finder.new.execute(scope: scope, params: params) end def collection_serializer Spree::Api::Dependencies.storefront_credit_card_serializer.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 def scope spree_current_user.credit_cards.accessible_by(current_ability, :show) end end end end end end end
Version data entries
38 entries across 38 versions & 1 rubygems