change bugs
This commit is contained in:
parent
7724c1bcce
commit
265562a260
|
@ -6,16 +6,17 @@ class SyncForgeController < ApplicationController
|
||||||
sync_params = params[:sync_params]
|
sync_params = params[:sync_params]
|
||||||
#以前已同步的项目,那么肯定存在仓库
|
#以前已同步的项目,那么肯定存在仓库
|
||||||
if Project.exists?(id: sync_params[:id], identifier: sync_params[:identifier])
|
if Project.exists?(id: sync_params[:id], identifier: sync_params[:identifier])
|
||||||
Rails.logger.info("=================begin_to_update_project========")
|
SyncLog.sync_log("=================begin_to_update_project========")
|
||||||
project = Project.find_by(id: sync_params[:id])
|
project = Project.find_by(id: sync_params[:id])
|
||||||
check_sync_project(project, sync_params)
|
check_sync_project(project, sync_params)
|
||||||
else #新建项目
|
else #新建项目
|
||||||
Rails.logger.info("=================begin_to_create_new_project========")
|
SyncLog.sync_log("=================begin_to_create_new_project========")
|
||||||
project_user = User.where(login: sync_params[:owner_login]).first
|
project_user = User.where(login: sync_params[:owner_login]).first
|
||||||
project_params = {
|
project_params = {
|
||||||
identifier: sync_params[:identifier],
|
identifier: sync_params[:identifier],
|
||||||
user_id: project_user.id,
|
user_id: project_user.id,
|
||||||
is_public: sync_params[:is_public]
|
private: !sync_params[:is_public],
|
||||||
|
name: sync_params[:name]
|
||||||
}
|
}
|
||||||
project = Projects::CreateService.new(project_user, project_params).call
|
project = Projects::CreateService.new(project_user, project_params).call
|
||||||
if project.present?
|
if project.present?
|
||||||
|
@ -194,7 +195,6 @@ class SyncForgeController < ApplicationController
|
||||||
|
|
||||||
def check_token
|
def check_token
|
||||||
sync_params = params[:sync_params]
|
sync_params = params[:sync_params]
|
||||||
Rails.logger.info("=======is_token:#{sync_params[:token] == get_token}=====================")
|
|
||||||
unless sync_params[:token] && sync_params[:token] == get_token
|
unless sync_params[:token] && sync_params[:token] == get_token
|
||||||
render json: {message: "token_errors"}
|
render json: {message: "token_errors"}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue