Skip to content
Snippets Groups Projects
Commit a913424a authored by Kamil Trzcinski's avatar Kamil Trzcinski Committed by Robert Speicher
Browse files

API for trigger when requested returns trigger request with commit...

API for trigger when requested returns trigger request with commit information, but without the created builds
parent 6ecbcdb0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -15,7 +15,7 @@ module API
authenticate_project_token!(project)
 
commits = project.commits.page(params[:page]).per(params[:per_page] || 20)
present commits, with: Entities::Commit
present commits, with: Entities::CommitWithBuilds
end
 
# Create a commit
Loading
Loading
@@ -53,7 +53,7 @@ module API
commit = CreateCommitService.new.execute(project, params[:data])
 
if commit.persisted?
present commit, with: Entities::Commit
present commit, with: Entities::CommitWithBuilds
else
errors = commit.errors.full_messages.join(", ")
render_api_error!(errors, 400)
Loading
Loading
Loading
Loading
@@ -4,6 +4,9 @@ module API
expose :id, :ref, :sha, :project_id, :before_sha, :created_at
expose :status, :finished_at, :duration
expose :git_commit_message, :git_author_name, :git_author_email
end
class CommitWithBuilds < Commit
expose :builds
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment