mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
simplify some tests, replace tags when updating tags (like for checklist)
This commit is contained in:
@@ -46,13 +46,13 @@ TaskSchema.plugin(baseModel, {
|
||||
});
|
||||
|
||||
// A list of additional fields that cannot be set on creation (but can be set on updare)
|
||||
let noCreate = ['completed'];
|
||||
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
|
||||
};
|
||||
|
||||
// A list of additional fields that cannot be updated (but can be set on creation)
|
||||
let noUpdate = ['_id', 'type']; // TODO should prevent changes to checlist.*.id
|
||||
let noUpdate = ['_id', 'type'];
|
||||
TaskSchema.statics.sanitizeUpdate = function sanitizeUpdate (updateObj) {
|
||||
return Task.sanitize(updateObj, noUpdate); // eslint-disable-line no-use-before-define
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user