diff options
Diffstat (limited to 'app/services/work_items/widgets/labels_service/update_service.rb')
-rw-r--r-- | app/services/work_items/widgets/labels_service/update_service.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/services/work_items/widgets/labels_service/update_service.rb b/app/services/work_items/widgets/labels_service/update_service.rb index f00ea5c95ca..b880398677d 100644 --- a/app/services/work_items/widgets/labels_service/update_service.rb +++ b/app/services/work_items/widgets/labels_service/update_service.rb @@ -5,6 +5,11 @@ module WorkItems module LabelsService class UpdateService < WorkItems::Widgets::BaseService def prepare_update_params(params: {}) + if new_type_excludes_widget? + params[:remove_label_ids] = @work_item.labels.map(&:id) + params[:add_label_ids] = [] + end + return if params.blank? service_params.merge!(params.slice(:add_label_ids, :remove_label_ids)) |