Prevent error when creating questions
This error didn't prevent the question from being sent.
This commit is contained in:
parent
1a29a19e9d
commit
d403cdde75
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue