Replace Entities::RunnerProjectDetails with Entities::ForkedFromProject
This commit is contained in:
parent
f8f492e589
commit
7ea60c8564
|
@ -122,7 +122,9 @@ Example response:
|
||||||
"projects": [
|
"projects": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
"name": "GitLab Community Edition",
|
||||||
"name_with_namespace": "GitLab.org / GitLab Community Edition",
|
"name_with_namespace": "GitLab.org / GitLab Community Edition",
|
||||||
|
"path": "gitlab-ce",
|
||||||
"path_with_namespace": "gitlab-org/gitlab-ce"
|
"path_with_namespace": "gitlab-org/gitlab-ce"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -170,7 +172,9 @@ Example response:
|
||||||
"projects": [
|
"projects": [
|
||||||
{
|
{
|
||||||
"id": 1,
|
"id": 1,
|
||||||
|
"name": "GitLab Community Edition",
|
||||||
"name_with_namespace": "GitLab.org / GitLab Community Edition",
|
"name_with_namespace": "GitLab.org / GitLab Community Edition",
|
||||||
|
"path": "gitlab-ce",
|
||||||
"path_with_namespace": "gitlab-org/gitlab-ce"
|
"path_with_namespace": "gitlab-org/gitlab-ce"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -369,12 +369,6 @@ module API
|
||||||
expose :id, :variables
|
expose :id, :variables
|
||||||
end
|
end
|
||||||
|
|
||||||
class RunnerProjectDetails < Grape::Entity
|
|
||||||
expose :id
|
|
||||||
expose :name_with_namespace
|
|
||||||
expose :path_with_namespace
|
|
||||||
end
|
|
||||||
|
|
||||||
class Runner < Grape::Entity
|
class Runner < Grape::Entity
|
||||||
expose :id
|
expose :id
|
||||||
expose :description
|
expose :description
|
||||||
|
@ -388,7 +382,7 @@ module API
|
||||||
expose :version, :revision, :platform, :architecture
|
expose :version, :revision, :platform, :architecture
|
||||||
expose :contacted_at, as: :last_contact
|
expose :contacted_at, as: :last_contact
|
||||||
expose :token, if: lambda { |runner, options| options[:current_user].is_admin? || !runner.is_shared? }
|
expose :token, if: lambda { |runner, options| options[:current_user].is_admin? || !runner.is_shared? }
|
||||||
expose :projects, with: Entities::RunnerProjectDetails do |runner, options|
|
expose :projects, with: Entities::ForkedFromProject do |runner, options|
|
||||||
if options[:current_user].is_admin?
|
if options[:current_user].is_admin?
|
||||||
runner.projects
|
runner.projects
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue