Merge pull request '检测用户是否在团队下' (#159) from KingChan/forgeplus:chenjing into standalone_develop
This commit is contained in:
commit
f5bf0c7a87
|
@ -1,8 +1,8 @@
|
||||||
class Organizations::TeamUsersController < Organizations::BaseController
|
class Organizations::TeamUsersController < Organizations::BaseController
|
||||||
before_action :load_organization, :load_team
|
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 :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]
|
before_action :check_user_can_edit_org, only: [:create, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -14,6 +14,10 @@ class Organizations::TeamUsersController < Organizations::BaseController
|
||||||
@team_users = kaminari_paginate(@team_users)
|
@team_users = kaminari_paginate(@team_users)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def pm_check_user
|
||||||
|
render_ok
|
||||||
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
@team_user = TeamUser.build(@organization.id, @operate_user.id, @team.id)
|
@team_user = TeamUser.build(@organization.id, @operate_user.id, @team.id)
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
class Issue < ApplicationRecord
|
class Issue < ApplicationRecord
|
||||||
#issue_type 1为普通,2为悬赏
|
#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
|
belongs_to :tracker,optional: true
|
||||||
has_many :project_trends, as: :trend, dependent: :destroy
|
has_many :project_trends, as: :trend, dependent: :destroy
|
||||||
has_one :pull_request
|
has_one :pull_request
|
||||||
|
|
|
@ -156,6 +156,7 @@ Rails.application.routes.draw do
|
||||||
resources :team_users, only: [:index, :create, :destroy] do
|
resources :team_users, only: [:index, :create, :destroy] do
|
||||||
collection do
|
collection do
|
||||||
delete :quit
|
delete :quit
|
||||||
|
get :pm_check_user
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
resources :team_projects, only: [:index, :create, :destroy] do
|
resources :team_projects, only: [:index, :create, :destroy] do
|
||||||
|
|
Loading…
Reference in New Issue