diff --git a/app/controllers/item_banks_controller.rb b/app/controllers/item_banks_controller.rb index a0abffe6c..f108c1fad 100644 --- a/app/controllers/item_banks_controller.rb +++ b/app/controllers/item_banks_controller.rb @@ -41,7 +41,11 @@ class ItemBanksController < ApplicationController def destroy ActiveRecord::Base.transaction do ApplyAction.where(container_type: "ItemBank", container_id: @item.id).destroy_all - @item.destroy! + if @item.item_type == "PROGRAM" + @item.container&.destroy! + else + @item.destroy! + end render_ok end end