diff options
Diffstat (limited to 'app/models/work_items/widgets/hierarchy.rb')
-rw-r--r-- | app/models/work_items/widgets/hierarchy.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/work_items/widgets/hierarchy.rb b/app/models/work_items/widgets/hierarchy.rb index fc6714f1e08..1d888dd71a8 100644 --- a/app/models/work_items/widgets/hierarchy.rb +++ b/app/models/work_items/widgets/hierarchy.rb @@ -23,6 +23,10 @@ module WorkItems [:set_parent, :add_child] end + def self.sync_params + [:parent] + end + def self.process_quick_action_param(param_name, value) return super unless param_name.in?(quick_action_params) && value.present? @@ -30,6 +34,16 @@ module WorkItems return { children: value } if param_name == :add_child end + + def self.process_sync_params(params) + parent_param = params.fetch(:parent, nil) + + if parent_param&.work_item + { parent: parent_param.work_item } + else + {} + end + end end end end |