Slack hooks fixes and improvements

closes #533
This commit is contained in:
Tom Moor
2018-01-28 19:37:14 -08:00
parent 97268314fe
commit f870cd88bc
3 changed files with 11 additions and 4 deletions

View File

@ -221,6 +221,10 @@ Document.addHook('afterUpdate', model =>
// Instance methods
Document.prototype.getTimestamp = function() {
return Math.round(new Date(this.updatedAt).getTime() / 1000);
};
Document.prototype.getSummary = function() {
const value = Markdown.deserialize(this.text);
const plain = Plain.serialize(value);