Class: Spree::Api::V3::Admin::StoreController

Inherits:
Admin::BaseController
  • Object
show all
Defined in:
app/controllers/spree/api/v3/admin/store_controller.rb

Instance Method Summary collapse

Instance Method Details

#showObject

GET /api/v3/admin/store



9
10
11
12
# File 'app/controllers/spree/api/v3/admin/store_controller.rb', line 9

def show
  authorize! :show, current_store
  render json: serialize_store
end

#updateObject

PATCH /api/v3/admin/store



15
16
17
18
19
20
21
22
23
# File 'app/controllers/spree/api/v3/admin/store_controller.rb', line 15

def update
  authorize! :update, current_store

  if current_store.update(permitted_params)
    render json: serialize_store
  else
    render_validation_error(current_store.errors)
  end
end