mirror of
https://github.com/discourse/discourse-solved.git
synced 2025-02-27 14:31:48 +00:00
FIX: yank existing notification when unaccepted
This commit is contained in:
parent
dd737a78b3
commit
944ff5a70f
10
plugin.rb
10
plugin.rb
@ -63,6 +63,16 @@ after_initialize do
|
|||||||
post.topic.save!
|
post.topic.save!
|
||||||
post.save!
|
post.save!
|
||||||
|
|
||||||
|
# yank notification
|
||||||
|
notification = Notification.find_by(
|
||||||
|
notification_type: Notification.types[:custom],
|
||||||
|
user_id: post.user_id,
|
||||||
|
topic_id: post.topic_id,
|
||||||
|
post_number: post.post_number
|
||||||
|
)
|
||||||
|
|
||||||
|
notification.destroy if notification
|
||||||
|
|
||||||
render json: success_json
|
render json: success_json
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user