API: better task defaults (for 3rd-party up/down scoring)

This commit is contained in:
Tyler Renelle
2013-12-25 10:56:21 -07:00
parent c7b5b5e601
commit 84ef3fb861
2 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -164,10 +164,10 @@ Even though Mongoose handles task defaults, we want to make sure defaults are se
sending up to the server for performance
###
api.taskDefaults = (task) ->
task.type = 'habit' unless task.type and task.type in ['habit','daily','todo','reward']
defaults =
id: api.uuid()
type: 'habit'
text: ''
text: if task.id? then task.id else ''
notes: ''
priority: 1
challenge: {}