Changed Collection documents to documentStructure and other WIP stuff
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
// @flow
|
||||
import slug from 'slug';
|
||||
import _ from 'lodash';
|
||||
import randomstring from 'randomstring';
|
||||
@ -98,6 +99,13 @@ const Document = sequelize.define(
|
||||
const slugifiedTitle = slugify(this.title);
|
||||
return `/d/${slugifiedTitle}-${this.urlId}`;
|
||||
},
|
||||
toJSON() {
|
||||
return {
|
||||
id: this.id,
|
||||
title: this.title,
|
||||
url: this.getUrl(),
|
||||
};
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
Reference in New Issue
Block a user