diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/projects.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index bd5678f513f..b23fe6cd4e7 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -388,7 +388,11 @@ module API desc 'Get languages in project repository' get ':id/languages' do - user_project.repository.languages.map { |language| language.values_at(:label, :value) }.to_h + 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 end desc 'Remove a project' |