Allow default tasks to not have notes

This commit is contained in:
Blade Barringer
2015-06-10 08:49:26 -05:00
parent 097e1ff70b
commit ed43bec8cd
2 changed files with 8 additions and 6 deletions

View File

@@ -406,7 +406,7 @@ var UserSchema = new Schema({
rewards: {type:[TaskSchemas.RewardSchema]},
extra: Schema.Types.Mixed,
pushDevices: {type: [{
regId: {type: String},
type: {type: String}
@@ -459,7 +459,9 @@ UserSchema.pre('save', function(next) {
newTask.name = newTask.name(self.preferences.language);
}else{
newTask.text = newTask.text(self.preferences.language);
newTask.notes = newTask.notes(self.preferences.language);
if(newTask.notes) {
newTask.notes = newTask.notes(self.preferences.language);
}
if(newTask.checklist){
newTask.checklist = _.map(newTask.checklist, function(checklistItem){