Merge branch 'fj-46411-fix-badge-api-endpoint-route-with-relative-url' into 'master'

Fixed badge api endpoint route when relative_url is set

Closes #46411

See merge request gitlab-org/gitlab-ce!19004
This commit is contained in:
Douwe Maan 2018-05-22 09:54:53 +00:00
commit 879ddf727d
3 changed files with 9 additions and 4 deletions

View file

@ -1,12 +1,12 @@
module Groups
module Settings
class BadgesController < Groups::ApplicationController
include GrapeRouteHelpers::NamedRouteMatcher
include API::Helpers::RelatedResourcesHelpers
before_action :authorize_admin_group!
def index
@badge_api_endpoint = api_v4_groups_badges_path(id: @group.id)
@badge_api_endpoint = expose_url(api_v4_groups_badges_path(id: @group.id))
end
end
end

View file

@ -1,12 +1,12 @@
module Projects
module Settings
class BadgesController < Projects::ApplicationController
include GrapeRouteHelpers::NamedRouteMatcher
include API::Helpers::RelatedResourcesHelpers
before_action :authorize_admin_project!
def index
@badge_api_endpoint = api_v4_projects_badges_path(id: @project.id)
@badge_api_endpoint = expose_url(api_v4_projects_badges_path(id: @project.id))
end
end
end

View file

@ -0,0 +1,5 @@
---
title: Fixed badge api endpoint route when relative url is set
merge_request: 19004
author:
type: fixed