fix: trace user exist and compact tasks create params

This commit is contained in:
yystopf 2022-05-16 09:58:47 +08:00
parent 04a733d99f
commit 5a728e7d4d
2 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ class Traces::ProjectsController < Traces::BaseController
limit = params[:limit] || params[:per_page]
limit = (limit.to_i.zero? || limit.to_i > 15) ? 15 : limit.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)
if code == 200
render :json => {data: data}

View File

@ -26,7 +26,7 @@ class Trace::CheckService < Trace::ClientService
git_url: repo['clone_url'],
if_branch: if_branch,
branch_tag: branch_tag
}
}.compact
end
def url