|
|
|
@ -41,7 +41,11 @@ class ItemBanksController < ApplicationController
|
|
|
|
|
def destroy
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all
|
|
|
|
|
if @item.item_type == "PROGRAM"
|
|
|
|
|
@item.container&.destroy!
|
|
|
|
|
else
|
|
|
|
|
@item.destroy!
|
|
|
|
|
end
|
|
|
|
|
render_ok
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|