diff options
author | HombreLaser <sebastian-440@live.com> | 2023-02-26 20:19:22 -0600 |
---|---|---|
committer | HombreLaser <sebastian-440@live.com> | 2023-02-26 20:19:22 -0600 |
commit | c86a5c9e05b183f10a63fb693c8af1d1d5a52e97 (patch) | |
tree | b8dd53b21b7e6ef9450ceeea3c61208a32052c64 /app/controllers/api | |
parent | 64171389726e6fde709f3f567eb27c5c94496b81 (diff) |
Refactoriza los create logics
Diffstat (limited to 'app/controllers/api')
-rw-r--r-- | app/controllers/api/authentications_controller/create_logic.rb | 8 | ||||
-rw-r--r-- | app/controllers/api/user_accounts_controller/create_logic.rb | 8 |
2 files changed, 2 insertions, 14 deletions
diff --git a/app/controllers/api/authentications_controller/create_logic.rb b/app/controllers/api/authentications_controller/create_logic.rb index 2f42852..782c760 100644 --- a/app/controllers/api/authentications_controller/create_logic.rb +++ b/app/controllers/api/authentications_controller/create_logic.rb @@ -15,15 +15,9 @@ module Api def call return unless @user_account&.authenticate(@password) - generate_user_session_key + generate_user_session_key(@user_account) generate_token end - - private - - def service_params - { email: @email, role: @user_account.role, session_key: @user_account.session_key } - end end end end diff --git a/app/controllers/api/user_accounts_controller/create_logic.rb b/app/controllers/api/user_accounts_controller/create_logic.rb index 3876c00..2e686b3 100644 --- a/app/controllers/api/user_accounts_controller/create_logic.rb +++ b/app/controllers/api/user_accounts_controller/create_logic.rb @@ -17,15 +17,9 @@ module Api return unless @user_account.save - generate_user_session_key + generate_user_session_key(@user_account) generate_token end - - private - - def service_params - { email: @user_account.email, role: @user_account.role, session_key: @user_account.session_key } - end end end end |