mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 23:23:52 +08:00
Fix up Notification model
This commit is contained in:
parent
f0d296bfb0
commit
ad33638a99
|
@ -1,17 +1,13 @@
|
||||||
import Model from '../Model';
|
import Model from '../Model';
|
||||||
import computed from '../utils/computed';
|
|
||||||
|
|
||||||
export default class Notification extends Model {}
|
export default class Notification extends Model {}
|
||||||
|
|
||||||
Object.assign(Notification.prototype, {
|
Object.assign(Notification.prototype, {
|
||||||
contentType: Model.attribute('contentType'),
|
contentType: Model.attribute('contentType'),
|
||||||
subjectId: Model.attribute('subjectId'),
|
|
||||||
content: Model.attribute('content'),
|
content: Model.attribute('content'),
|
||||||
time: Model.attribute('time', Model.date),
|
createdAt: Model.attribute('createdAt', Model.transformDate),
|
||||||
|
|
||||||
isRead: Model.attribute('isRead'),
|
isRead: Model.attribute('isRead'),
|
||||||
unreadCount: Model.attribute('unreadCount'),
|
|
||||||
additionalUnreadCount: computed('unreadCount', unreadCount => Math.max(0, unreadCount - 1)),
|
|
||||||
|
|
||||||
user: Model.hasOne('user'),
|
user: Model.hasOne('user'),
|
||||||
fromUser: Model.hasOne('fromUser'),
|
fromUser: Model.hasOne('fromUser'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user