mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Tasks is due (#8711)
* Added isDue field and isDue set on create * Added isDue update on update task * Add isdue calc to score task * Added isdue calc to cron * Fixed lint issue * Added isDue to no set and updated grammar
This commit is contained in:
@@ -92,7 +92,7 @@ export let TaskSchema = new Schema({
|
||||
}, discriminatorOptions));
|
||||
|
||||
TaskSchema.plugin(baseModel, {
|
||||
noSet: ['challenge', 'userId', 'completed', 'history', 'dateCompleted', '_legacyId', 'group'],
|
||||
noSet: ['challenge', 'userId', 'completed', 'history', 'dateCompleted', '_legacyId', 'group', 'isDue'],
|
||||
sanitizeTransform (taskObj) {
|
||||
if (taskObj.type && taskObj.type !== 'reward') { // value should be settable directly only for rewards
|
||||
delete taskObj.value;
|
||||
@@ -242,6 +242,7 @@ export let DailySchema = new Schema(_.defaults({
|
||||
streak: {type: Number, default: 0},
|
||||
daysOfMonth: {type: [Number], default: []}, // Days of the month that the daily should repeat on
|
||||
weeksOfMonth: {type: [Number], default: []}, // Weeks of the month that the daily should repeat on
|
||||
isDue: {type: Boolean},
|
||||
}, habitDailySchema(), dailyTodoSchema()), subDiscriminatorOptions);
|
||||
export let daily = Task.discriminator('daily', DailySchema);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user