Prevent error when creating questions

This error didn't prevent the question from being sent.
This commit is contained in:
Karina Kwiatek 2023-01-02 13:30:32 +01:00 committed by Andreas Nedbal
parent 1a29a19e9d
commit d403cdde75
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ module UseCase
increment_asked_count increment_asked_count
inbox = ::Inbox.create!(user: target_user, question:, new: true) inbox = ::Inbox.create!(user: target_user, question:, new: true)
notify notify(inbox)
{ {
status: 201, status: 201,
@ -75,7 +75,7 @@ module UseCase
) )
end end
def notify def notify(inbox)
webpush_app = ::Rpush::App.find_by(name: "webpush") webpush_app = ::Rpush::App.find_by(name: "webpush")
target_user.push_notification(webpush_app, inbox) if webpush_app target_user.push_notification(webpush_app, inbox) if webpush_app
end end