mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-24 04:39:59 +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 Settings
|
||||
class UserTeamsController < ApplicationController
|
||||
include NotificationsHelper
|
||||
include InputSanitizeHelper
|
||||
|
||||
before_action :load_user, only: :destroy
|
||||
|
||||
before_action :load_user_team, only: [
|
||||
|
|
@ -12,7 +15,7 @@ module Users
|
|||
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @user_team.update(update_user_team_params)
|
||||
if @user_team.update(update_params)
|
||||
format.json do
|
||||
render json: {
|
||||
status: :ok
|
||||
|
|
@ -145,6 +148,12 @@ module Users
|
|||
end
|
||||
end
|
||||
|
||||
def update_params
|
||||
params.require(:user_team).permit(
|
||||
:role
|
||||
)
|
||||
end
|
||||
|
||||
def reset_user_current_team(user_team)
|
||||
ids = user_team.user.teams_ids
|
||||
ids -= [user_team.team.id]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
class Users::SettingsController < ApplicationController
|
||||
include UsersGenerator
|
||||
include NotificationsHelper
|
||||
include InputSanitizeHelper
|
||||
|
||||
before_action :load_user, only: [
|
||||
:user_current_team
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue