fix: trace user exist and compact tasks create params
This commit is contained in:
parent
04a733d99f
commit
5a728e7d4d
|
@ -32,6 +32,7 @@ class Traces::ProjectsController < Traces::BaseController
|
||||||
limit = params[:limit] || params[:per_page]
|
limit = params[:limit] || params[:per_page]
|
||||||
limit = (limit.to_i.zero? || limit.to_i > 15) ? 15 : limit.to_i
|
limit = (limit.to_i.zero? || limit.to_i > 15) ? 15 : limit.to_i
|
||||||
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
|
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
|
||||||
|
return render :json => {data: []} if current_user.trace_user.nil?
|
||||||
code, data, error = Trace::CheckResultService.call(current_user.trace_token, @project, nil, page, limit)
|
code, data, error = Trace::CheckResultService.call(current_user.trace_token, @project, nil, page, limit)
|
||||||
if code == 200
|
if code == 200
|
||||||
render :json => {data: data}
|
render :json => {data: data}
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Trace::CheckService < Trace::ClientService
|
||||||
git_url: repo['clone_url'],
|
git_url: repo['clone_url'],
|
||||||
if_branch: if_branch,
|
if_branch: if_branch,
|
||||||
branch_tag: branch_tag
|
branch_tag: branch_tag
|
||||||
}
|
}.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
def url
|
def url
|
||||||
|
|
Loading…
Reference in New Issue