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