File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
controllers/better_together
javascript/controllers/better_together Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ def index
1414 def mark_as_read # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
1515 if params [ :id ]
1616 mark_notification_as_read ( params [ :id ] )
17- elsif params [ :message_id ]
18- mark_message_as_read ( params [ :message_id ] )
17+ elsif params [ :record_id ]
18+ mark_record_notification_as_read ( params [ :message_id ] )
1919 else
2020 helpers . current_person . notifications . unread . update_all ( read_at : Time . current )
2121 end
@@ -41,11 +41,11 @@ def mark_notification_as_read(id)
4141 @notification . update ( read_at : Time . current )
4242 end
4343
44- def mark_message_as_read ( id )
45- @notification = helpers . current_person . notifications . unread . includes (
44+ def mark_record_notification_as_read ( id )
45+ @notifications = helpers . current_person . notifications . unread . includes (
4646 :event
4747 ) . references ( :event ) . where ( event : { record_id : id } )
48- @notification . update ( read_at : Time . current )
48+ @notifications . update_all ( read_at : Time . current )
4949 end
5050 end
5151end
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export default class extends Controller {
3737 'X-CSRF-Token' : this . getCSRFToken ( )
3838 } ,
3939 body : JSON . stringify ( {
40- message_id : messageId
40+ record_id : messageId
4141 } )
4242 } )
4343 . then ( response => {
You can’t perform that action at this time.
0 commit comments