added 260907 version of worker toolkit

This commit is contained in:
2026-09-08 20:30:51 -04:00
parent cbd3f0f8ca
commit 97aca37663
1283 changed files with 142951 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
import Ember from 'ember';
const {
get,
set,
inject: {
service,
},
Mixin
} = Ember;
export default Mixin.create({
ajax: service(),
notifications: service(),
store: service(),
updatePostNotifications(post) {
const ajax = get(this, 'ajax');
if (get(post, 'notifications.reaction') && get(this, 'updateNotifications')) {
const id = get(post, 'id');
const store = get(this, 'store');
ajax
.put(`notifications/post/${id}`)
.then(({ notifications }) => {
notifications.forEach((n) => {
const model = store.peekRecord('notification', n.id);
if(model){
set(model, 'unread', false);
}
});
set(post, 'notifications', {});
});
}
}
});