Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-12-05 05:18:45 +0300
committerEric Eastwood <contact@ericeastwood.com>2017-12-07 20:19:37 +0300
commite6ac6734c2f636d3d063718a95ba1169e299b51f (patch)
tree5ebb145da1c9f9f242b13ca3ccfdcc176766c3e3 /lib
parent9dffd0ab6b2e9f5b0db55230d8991f50a01f7669 (diff)
Use relative _path helper URLs in the GitLab UI
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40825
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 62ee20bf7de..d96e7f2770f 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -16,10 +16,13 @@ module API
class UserBasic < UserSafe
expose :state
+
expose :avatar_url do |user, options|
user.avatar_url(only_path: false)
end
+ expose :avatar_path, if: ->(user, options) { options.fetch(:only_path, false) && user.avatar_path }
+
expose :web_url do |user, options|
Gitlab::Routing.url_helpers.user_url(user)
end