change bugs
This commit is contained in:
parent
7724c1bcce
commit
265562a260
|
@ -6,16 +6,17 @@ class SyncForgeController < ApplicationController
|
|||
sync_params = params[:sync_params]
|
||||
#以前已同步的项目,那么肯定存在仓库
|
||||
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])
|
||||
check_sync_project(project, sync_params)
|
||||
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_params = {
|
||||
identifier: sync_params[:identifier],
|
||||
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
|
||||
if project.present?
|
||||
|
@ -194,7 +195,6 @@ class SyncForgeController < ApplicationController
|
|||
|
||||
def check_token
|
||||
sync_params = params[:sync_params]
|
||||
Rails.logger.info("=======is_token:#{sync_params[:token] == get_token}=====================")
|
||||
unless sync_params[:token] && sync_params[:token] == get_token
|
||||
render json: {message: "token_errors"}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue