Class: Spree::Api::V2::Storefront::Account::QrDataController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Storefront::Account::QrDataController
- Defined in:
- app/controllers/spree/api/v2/storefront/account/qr_data_controller.rb
Instance Method Summary collapse
-
#resource_serializer ⇒ Object
override.
-
#update ⇒ Object
override invalidate existing QR data and return new QR data with user info.
Instance Method Details
#resource_serializer ⇒ Object
override
22 23 24 |
# File 'app/controllers/spree/api/v2/storefront/account/qr_data_controller.rb', line 22 def resource_serializer Spree::V2::Storefront::UserSerializer end |
#update ⇒ Object
override invalidate existing QR data and return new QR data with user info.
11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/spree/api/v2/storefront/account/qr_data_controller.rb', line 11 def update result = SpreeCmCommissioner::Users::QrData::Invalidate.call(user: spree_current_user) if result.success? render_serialized_payload { serialize_resource(result.value) } else render_error_payload(result.error) end end |