Fixed Collection#updateDocument

This commit is contained in:
Jori Lallo
2017-06-04 22:12:36 -07:00
parent c229369efd
commit a4dca58ae7
4 changed files with 85 additions and 57 deletions

View File

@@ -100,10 +100,13 @@ const Document = sequelize.define(
return `/d/${slugifiedTitle}-${this.urlId}`;
},
toJSON() {
// Warning: only use for new documents as order of children is
// handled in the collection's documentStructure
return {
id: this.id,
title: this.title,
url: this.getUrl(),
children: [],
};
},
},