feat(backend): seed posts as article

This commit is contained in:
Moriz Wahl 2023-04-17 14:22:09 +02:00
parent 738e7ad64c
commit 0dfc86f1d2
2 changed files with 2 additions and 1 deletions

View File

@ -165,7 +165,7 @@ Factory.define('post')
})
.after(async (buildObject, options) => {
const [post, author, image, /* categories, */ tags] = await Promise.all([
neode.create('Post', buildObject),
neode.create('Article', buildObject),
options.author,
options.image,
// options.categories,

View File

@ -23,6 +23,7 @@ export function getNeode(options = {}) {
if (!neodeInstance) {
const { uri, username, password } = { ...defaultOptions, ...options }
neodeInstance = new Neode(uri, username, password).with(models)
neodeInstance.extend('Post', 'Article', {})
return neodeInstance
}
return neodeInstance