Add created field to trial requests

Necessary for importing external trial requests.
This commit is contained in:
Matt Lott 2015-11-19 15:20:39 -08:00
parent 2fecaf9618
commit 804c62e13b
2 changed files with 2 additions and 0 deletions

View file

@ -7,6 +7,7 @@ TrialRequestSchema = c.object {
_.extend TrialRequestSchema.properties,
applicant: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])
created: c.date({readOnly: true})
prepaidCode: c.objectId()
reviewDate: c.date({readOnly: true})
reviewer: c.objectId(links: [{rel: 'extra', href: '/db/user/{($)}'}])

View file

@ -19,6 +19,7 @@ TrialRequestHandler = class TrialRequestHandler extends Handler
makeNewInstance: (req) ->
instance = super(req)
instance.set 'applicant', req.user._id
instance.set 'created', new Date()
instance.set 'status', 'submitted'
instance