Sha256: d815a3a4f75b1aaf4fa22ed20857dbc0ccf8b30e464bf03917f0ff9c6aa2ac3b
Contents?: true
Size: 924 Bytes
Versions: 2
Compression:
Stored size: 924 Bytes
Contents
module Spree module Api module V2 module Platform class MenuItemsController < ResourceController before_action -> { doorkeeper_authorize! :write, :admin }, only: WRITE_ACTIONS << :reposition def reposition spree_authorize! :update, @moved_item if spree_current_user.present? @moved_item = scope.find(params[:moved_item_id]) @new_parent = scope.find(params[:new_parent_id]) new_index = params[:new_position_idx].to_i if @moved_item && @new_parent && new_index @moved_item.move_to_child_with_index(@new_parent, new_index) else head :bad_request end if @moved_item.save head :no_content end end private def model_class Spree::MenuItem end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
spree_api-4.3.0.rc2 | app/controllers/spree/api/v2/platform/menu_items_controller.rb |
spree_api-4.3.0.rc1 | app/controllers/spree/api/v2/platform/menu_items_controller.rb |