mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
add clearCompletedTodos route with tests, add test for getting completed todos, misc fixes
This commit is contained in:
@@ -48,13 +48,13 @@ TaskSchema.plugin(baseModel, {
|
||||
// A list of additional fields that cannot be set on creation (but can be set on updare)
|
||||
let noCreate = ['completed']; // TODO completed should be removed for updates too?
|
||||
TaskSchema.statics.sanitizeCreate = function sanitizeCreate (createObj) {
|
||||
return Task.sanitize(createObj, noCreate); // eslint-disable-line no-use-before-define
|
||||
return this.sanitize(createObj, noCreate);
|
||||
};
|
||||
|
||||
// A list of additional fields that cannot be updated (but can be set on creation)
|
||||
let noUpdate = ['_id', 'type'];
|
||||
TaskSchema.statics.sanitizeUpdate = function sanitizeUpdate (updateObj) {
|
||||
return Task.sanitize(updateObj, noUpdate); // eslint-disable-line no-use-before-define
|
||||
return this.sanitize(updateObj, noUpdate);
|
||||
};
|
||||
|
||||
// Sanitize checklist objects (disallowing _id)
|
||||
|
||||
Reference in New Issue
Block a user