mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
add dateCreated to all tasks; add empty challenge object to tasks that don't have one (#7386)
This commit is contained in:
@@ -134,6 +134,8 @@ TaskSchema.methods.toJSONV2 = function toJSONV2 () {
|
||||
toJSON.id = toJSON._id;
|
||||
}
|
||||
|
||||
if (!toJSON.challenge) toJSON.challenge = {};
|
||||
|
||||
let v3Tags = this.tags;
|
||||
|
||||
toJSON.tags = {};
|
||||
@@ -141,6 +143,8 @@ TaskSchema.methods.toJSONV2 = function toJSONV2 () {
|
||||
toJSON.tags[tag] = true;
|
||||
});
|
||||
|
||||
toJSON.dateCreated = this.createdAt;
|
||||
|
||||
return toJSON;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user