change find_project function
This commit is contained in:
parent
4eb2428ef1
commit
3abe5ff4b3
|
@ -145,12 +145,11 @@ module Mobile
|
|||
post 'getJoinInfo' do
|
||||
authenticate!
|
||||
# 根据repo_git_url找到repository对应的项目
|
||||
Rails.logger.info(params)
|
||||
rs = RepositoriesService.new
|
||||
if params[:ownername] != nil and params[:reponame] != nil
|
||||
owner = User.find_by_login(params[:ownername])
|
||||
if owner
|
||||
project = Project.find_by_sql("select * from projects where user_id='#{owner.id}' and name='#{params[:reponame]}'")
|
||||
project = Project.find_by_user_id_name(owner.id, params[:reponame])
|
||||
node_ids = BlockchainProjectClient.find_by_sql("select node_id from blockchain_project_clients where project_id='#{project.id}' and user_id='#{current_user.id}'").map(&:node_id)
|
||||
result = {:node_ids => node_ids, :status => status} # 定义变量记录返回值
|
||||
present result
|
||||
|
|
Loading…
Reference in New Issue