This commit is contained in:
呱呱呱 2023-10-12 11:12:53 +08:00
parent 6cb7af0401
commit 19d36af37f
3 changed files with 8 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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