mirror of
https://github.com/overleaf/overleaf.git
synced 2024-09-16 02:52:31 -04:00
Alter how the notification doc is built
This commit is contained in:
parent
7bb6e6e18c
commit
0a5430468c
2 changed files with 2 additions and 3 deletions
|
@ -27,11 +27,11 @@ module.exports =
|
||||||
key: notification.key
|
key: notification.key
|
||||||
messageOpts: notification.messageOpts
|
messageOpts: notification.messageOpts
|
||||||
templateKey: notification.templateKey
|
templateKey: notification.templateKey
|
||||||
expires: notification.expires || false
|
|
||||||
# ttl index on `expiresFrom` field
|
# ttl index on `expiresFrom` field
|
||||||
# in Mongo, TTL indexes only work on date fields,
|
# in Mongo, TTL indexes only work on date fields,
|
||||||
# and ignore the document when that field is missing
|
# and ignore the document when that field is missing
|
||||||
if doc.expires
|
if notification.expires?
|
||||||
|
doc.expires = notification.expires
|
||||||
doc.expiresFrom = new Date()
|
doc.expiresFrom = new Date()
|
||||||
db.notifications.insert(doc, callback)
|
db.notifications.insert(doc, callback)
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@ describe 'Notifications Tests', ->
|
||||||
key:"notification-key",
|
key:"notification-key",
|
||||||
messageOpts:"some info",
|
messageOpts:"some info",
|
||||||
templateKey:"template-key",
|
templateKey:"template-key",
|
||||||
expires: false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it 'should insert the notification into the collection', (done)->
|
it 'should insert the notification into the collection', (done)->
|
||||||
|
|
Loading…
Reference in a new issue