Remove checks with removing list related to antenna

This commit is contained in:
KMY 2023-08-21 12:23:42 +09:00
parent 86c63d2dbb
commit b65a022ac3
3 changed files with 2 additions and 3 deletions

View file

@ -31,7 +31,8 @@ class Api::V1::ListsController < Api::BaseController
end
def destroy
raise Mastodon::ValidationError, I18n.t('antennas.errors.remove_list_with_antenna') if Antenna.where(list_id: @list.id).any?
antenna = Antenna.find_by(list_id: @list.id)
antenna.update!(list_id: 0) if antenna.present?
@list.destroy!
render_empty