Skip to content

Commit

Permalink
fix tests - pick the text / up/down props too
Browse files Browse the repository at this point in the history
  • Loading branch information
negue committed Sep 25, 2018
1 parent d7a245a commit e12ef02
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions website/server/models/task.js
Expand Up @@ -169,9 +169,14 @@ TaskSchema.statics.findByIdOrAlias = async function findByIdOrAlias (identifier,
// Sanitize user tasks linked to a challenge
// See http://habitica.wikia.com/wiki/Challenges#Challenge_Participant.27s_Permissions for more info
TaskSchema.statics.sanitizeUserChallengeTask = function sanitizeUserChallengeTask (taskObj) {
let initialSanitization = this.sanitize(taskObj);

return _.pick(initialSanitization, ['streak', 'checklist', 'attribute', 'reminders', 'tags', 'notes', 'collapseChecklist', 'alias', 'yesterDaily', 'counterDown', 'counterUp']);
const initialSanitization = this.sanitize(taskObj);

return _.pick(initialSanitization, [
'streak', 'checklist', 'attribute', 'reminders',
'tags', 'notes', 'text', 'collapseChecklist',
'alias', 'yesterDaily', 'counterDown', 'counterUp',
'up', 'down',
]);
};

// Sanitize checklist objects (disallowing id)
Expand Down

0 comments on commit e12ef02

Please sign in to comment.