mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
(feat) Improved performance when marking all notifications as read
This commit is contained in:
parent
9bc146d037
commit
b0a204dd1d
@ -4,6 +4,7 @@
|
|||||||
- Fix a bug: unable to update Store Order sub type in statistics
|
- Fix a bug: unable to update Store Order sub type in statistics
|
||||||
- Fix a bug: unable to create plan with plan limitation
|
- Fix a bug: unable to create plan with plan limitation
|
||||||
- Ability to show all availabilities in calender for admin
|
- Ability to show all availabilities in calender for admin
|
||||||
|
- Improved performance when marking all notifications as read
|
||||||
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`
|
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`
|
||||||
|
|
||||||
## v6.0.8 2023 July 03
|
## v6.0.8 2023 July 03
|
||||||
|
@ -65,7 +65,8 @@ class API::NotificationsController < API::APIController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_all
|
def update_all
|
||||||
current_user.notifications.where(is_read: false).find_each(&:mark_as_read)
|
current_user.notifications.where(is_read: false)
|
||||||
|
.update_all(is_read: true, updated_at: Time.current) # rubocop:disable Rails/SkipsModelValidations
|
||||||
head :no_content
|
head :no_content
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user