mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 23:57:49 +01:00
test index, create list
This commit is contained in:
@@ -26,9 +26,9 @@ TodoSchema.pre('remove', async function () {
|
||||
|
||||
TodoSchema.methods.toJson = function () {
|
||||
return {
|
||||
id: this._id,
|
||||
id: this._id.toString(),
|
||||
text: this.text,
|
||||
list: this.list,
|
||||
list: this.list.toString(),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ TodoListSchema.pre('remove', async function () {
|
||||
TodoListSchema.methods.toJson = function () {
|
||||
const todos = this.populated('todos') ? this.todos.map(todo => todo.toJson()) : this.todos;
|
||||
return {
|
||||
id: this._id,
|
||||
id: this._id.toString(),
|
||||
name: this.name,
|
||||
slug: this.slug,
|
||||
todos,
|
||||
|
||||
Reference in New Issue
Block a user