Skip to content

Commit

Permalink
feat(notification): fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andreybakanovsky committed Sep 11, 2023
1 parent c22632a commit de7d6e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
17 changes: 10 additions & 7 deletions app/controllers/spends_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ def create
originator: current_user,
access_token: Devise.friendly_token
)

if account.notification?
TransactionsMailer.transaction_notification(account).deliver
account.account_shares.accepted.each do |account_share|
TransactionsMailer.transaction_notification(account, account_share).deliver
end
end
send_notification

redirect_to account_path(account)
end

def send_notification
return unless account.notification?

TransactionsMailer.transaction_notification(account).deliver
account.account_shares.accepted.each do |account_share|
TransactionsMailer.transaction_notification(account, account_share).deliver
end
end
end
17 changes: 10 additions & 7 deletions app/controllers/topups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ def create
originator: current_user,
access_token: Devise.friendly_token
)

if account.notification?
TransactionsMailer.transaction_notification(account).deliver
account.account_shares.accepted.each do |account_share|
TransactionsMailer.transaction_notification(account, account_share).deliver
end
end
send_notification

redirect_to account_path(account)
end

def send_notification
return unless account.notification?

TransactionsMailer.transaction_notification(account).deliver
account.account_shares.accepted.each do |account_share|
TransactionsMailer.transaction_notification(account, account_share).deliver
end
end
end

0 comments on commit de7d6e4

Please sign in to comment.