mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-26 14:06:23 +08:00
Some minor fixes
This commit is contained in:
parent
f7bd62547e
commit
2a9f975c13
2 changed files with 10 additions and 3 deletions
|
|
@ -1,6 +1,9 @@
|
||||||
module Users
|
module Users
|
||||||
module Settings
|
module Settings
|
||||||
class UserTeamsController < ApplicationController
|
class UserTeamsController < ApplicationController
|
||||||
|
include NotificationsHelper
|
||||||
|
include InputSanitizeHelper
|
||||||
|
|
||||||
before_action :load_user, only: :destroy
|
before_action :load_user, only: :destroy
|
||||||
|
|
||||||
before_action :load_user_team, only: [
|
before_action :load_user_team, only: [
|
||||||
|
|
@ -12,7 +15,7 @@ module Users
|
||||||
|
|
||||||
def update
|
def update
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @user_team.update(update_user_team_params)
|
if @user_team.update(update_params)
|
||||||
format.json do
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
status: :ok
|
status: :ok
|
||||||
|
|
@ -145,6 +148,12 @@ module Users
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_params
|
||||||
|
params.require(:user_team).permit(
|
||||||
|
:role
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
def reset_user_current_team(user_team)
|
def reset_user_current_team(user_team)
|
||||||
ids = user_team.user.teams_ids
|
ids = user_team.user.teams_ids
|
||||||
ids -= [user_team.team.id]
|
ids -= [user_team.team.id]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
class Users::SettingsController < ApplicationController
|
class Users::SettingsController < ApplicationController
|
||||||
include UsersGenerator
|
include UsersGenerator
|
||||||
include NotificationsHelper
|
|
||||||
include InputSanitizeHelper
|
|
||||||
|
|
||||||
before_action :load_user, only: [
|
before_action :load_user, only: [
|
||||||
:user_current_team
|
:user_current_team
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue