diff options
author | John Jarvis <jarv@gitlab.com> | 2019-04-02 10:12:32 +0200 |
---|---|---|
committer | John Jarvis <jarv@gitlab.com> | 2019-04-02 10:12:32 +0200 |
commit | 69b65a6b745e74bba290787420a0017395fd7c25 (patch) | |
tree | c328963cbe5b340c58c88230d21f338c77462ebd /lib/api | |
parent | 1b6fe3ae226e4c6f481c90c886e242fcd96ab11b (diff) | |
parent | 3e81a5baf25d6ecd9ad807a2b8f4238dcc598d5e (diff) | |
download | gitlab-ce-69b65a6b745e74bba290787420a0017395fd7c25.tar.gz |
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into jarv/dev-to-gitlab-2019-04-02jarv/dev-to-gitlab-2019-04-02
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/projects.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 0f4a47677d9..57336e95041 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -373,11 +373,9 @@ module API desc 'Get languages in project repository' get ':id/languages' do - if user_project.repository_languages.present? - user_project.repository_languages.map { |l| [l.name, l.share] }.to_h - else - user_project.repository.languages.map { |language| language.values_at(:label, :value) }.to_h - end + ::Projects::RepositoryLanguagesService + .new(user_project, current_user) + .execute.map { |lang| [lang.name, lang.share] }.to_h end desc 'Remove a project' |