Add support for close/reopen actions in update service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
cc77365488
commit
ed67ba9663
2 changed files with 11 additions and 2 deletions
|
@ -3,7 +3,7 @@ module Issues
|
|||
def execute(issue)
|
||||
if issue.reopen
|
||||
event_service.reopen_issue(issue, current_user)
|
||||
create_note(issue, commit)
|
||||
create_note(issue)
|
||||
execute_hooks(issue)
|
||||
end
|
||||
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
module Issues
|
||||
class UpdateService < BaseService
|
||||
def execute(issue)
|
||||
if issue.update_attributes(params)
|
||||
state = params.delete('state_event')
|
||||
|
||||
case state
|
||||
when 'reopen'
|
||||
Issues::ReopenService.new(project, current_user, {}).execute(issue)
|
||||
when 'close'
|
||||
Issues::CloseService.new(project, current_user, {}).execute(issue)
|
||||
end
|
||||
|
||||
if params.present? && issue.update_attributes(params)
|
||||
issue.reset_events_cache
|
||||
|
||||
if issue.is_being_reassigned?
|
||||
|
|
Loading…
Reference in a new issue