Merge pull request #5306 from aignatov-bio/ai-sci-8317-fix-messages-filter-in-notification-flyout

Fix messages filter in notifcation flyout [SCI-8317]
This commit is contained in:
aignatov-bio 2023-04-14 13:28:03 +02:00 committed by GitHub
commit ea4fe49699
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,11 +15,11 @@ class UserNotificationsController < ApplicationController
end
UserNotification.where(
notification_id: notifications.where.not(type_of: 2).select(:id)
notification_id: notifications.except(:select).where.not(type_of: 2).select(:id)
).seen_by_user(current_user)
current_user.user_system_notifications.where(
system_notification_id: notifications.where(type_of: 2).select(:id)
system_notification_id: notifications.except(:select).where(type_of: 2).select(:id)
).mark_as_seen
end