diff options
author | James Ramsay <jramsay@gitlab.com> | 2018-08-02 22:39:46 +0300 |
---|---|---|
committer | James Ramsay <jramsay@gitlab.com> | 2018-08-03 18:55:21 +0300 |
commit | 79d90cb6bd99b7af572c65af89597c2e55217aea (patch) | |
tree | d28302d2bd63504b46c4eeef2877b4a3d099f893 /lib/api/projects.rb | |
parent | c60cb3935089eeb358b8e96e63d879d5b49a3dcf (diff) |
Use Projects::UpdateService to archive projects
System hooks were not being triggered when projects were archived or
unarchived. Reuse the Projects::UpdateService to automatically
trigger system hooks and increase code reuse.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 7adde79d6c3..5738bf220c6 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -321,7 +321,7 @@ module API post ':id/archive' do authorize!(:archive_project, user_project) - user_project.archive! + ::Projects::UpdateService.new(user_project, current_user, archived: true).execute present user_project, with: Entities::Project end @@ -332,7 +332,7 @@ module API post ':id/unarchive' do authorize!(:archive_project, user_project) - user_project.unarchive! + ::Projects::UpdateService.new(@project, current_user, archived: false).execute present user_project, with: Entities::Project end |