From 19d36af37fa9663ce692170ec928eb7550e879f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=B1=E5=91=B1=E5=91=B1?= Date: Thu, 12 Oct 2023 11:12:53 +0800 Subject: [PATCH] update --- app/controllers/organizations/team_users_controller.rb | 8 ++++++-- app/models/issue.rb | 2 +- config/routes.rb | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/organizations/team_users_controller.rb b/app/controllers/organizations/team_users_controller.rb index 7a71dbbad..b6c4ed29d 100644 --- a/app/controllers/organizations/team_users_controller.rb +++ b/app/controllers/organizations/team_users_controller.rb @@ -1,8 +1,8 @@ class Organizations::TeamUsersController < Organizations::BaseController before_action :load_organization, :load_team - before_action :load_operate_user, only: [:create, :destroy] + before_action :load_operate_user, only: [:create, :destroy, :check_user] before_action :check_user_profile_completed, only: [:create] - before_action :load_team_user, only: [:destroy] + before_action :load_team_user, only: [:destroy, :check_user] before_action :check_user_can_edit_org, only: [:create, :destroy] def index @@ -14,6 +14,10 @@ class Organizations::TeamUsersController < Organizations::BaseController @team_users = kaminari_paginate(@team_users) end + def pm_check_user + render_ok + end + def create ActiveRecord::Base.transaction do @team_user = TeamUser.build(@organization.id, @operate_user.id, @team.id) diff --git a/app/models/issue.rb b/app/models/issue.rb index eae5acf6f..4420ed18e 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -51,7 +51,7 @@ class Issue < ApplicationRecord #issue_type 1为普通,2为悬赏 - belongs_to :project, counter_cache: true, touch: true + belongs_to :project, counter_cache: true, touch: true, optional: true belongs_to :tracker,optional: true has_many :project_trends, as: :trend, dependent: :destroy has_one :pull_request diff --git a/config/routes.rb b/config/routes.rb index cc10bd987..07cc9d6ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -156,6 +156,7 @@ Rails.application.routes.draw do resources :team_users, only: [:index, :create, :destroy] do collection do delete :quit + get :pm_check_user end end resources :team_projects, only: [:index, :create, :destroy] do