summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorJohn Jarvis <jarv@gitlab.com>2019-04-02 10:12:32 +0200
committerJohn Jarvis <jarv@gitlab.com>2019-04-02 10:12:32 +0200
commit69b65a6b745e74bba290787420a0017395fd7c25 (patch)
treec328963cbe5b340c58c88230d21f338c77462ebd /lib/api
parent1b6fe3ae226e4c6f481c90c886e242fcd96ab11b (diff)
parent3e81a5baf25d6ecd9ad807a2b8f4238dcc598d5e (diff)
downloadgitlab-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.rb8
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'