mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Update seeds to create post with a category
This commit is contained in:
parent
a000719663
commit
7bbbf40bcc
@ -276,131 +276,82 @@ import Factory from './factories'
|
||||
asAdmin.create('Post', {
|
||||
id: 'p0',
|
||||
image: faker.image.unsplash.food(),
|
||||
categoryIds: ['cat16'],
|
||||
}),
|
||||
asModerator.create('Post', {
|
||||
id: 'p1',
|
||||
image: faker.image.unsplash.technology(),
|
||||
categoryIds: ['cat1'],
|
||||
}),
|
||||
asUser.create('Post', {
|
||||
id: 'p2',
|
||||
title: `Nature Philosophy Yoga`,
|
||||
content: `${hashtag1}`,
|
||||
categoryIds: ['cat2'],
|
||||
}),
|
||||
asTick.create('Post', {
|
||||
id: 'p3',
|
||||
categoryIds: ['cat3'],
|
||||
}),
|
||||
asTrick.create('Post', {
|
||||
id: 'p4',
|
||||
categoryIds: ['cat4'],
|
||||
}),
|
||||
asTrack.create('Post', {
|
||||
id: 'p5',
|
||||
categoryIds: ['cat5'],
|
||||
}),
|
||||
asAdmin.create('Post', {
|
||||
id: 'p6',
|
||||
image: faker.image.unsplash.buildings(),
|
||||
categoryIds: ['cat6'],
|
||||
}),
|
||||
asModerator.create('Post', {
|
||||
id: 'p7',
|
||||
content: `${mention1} ${faker.lorem.paragraph()}`,
|
||||
categoryIds: ['cat7'],
|
||||
}),
|
||||
asUser.create('Post', {
|
||||
id: 'p8',
|
||||
image: faker.image.unsplash.nature(),
|
||||
title: `Quantum Flow Theory explains Quantum Gravity`,
|
||||
content: `${hashtagAndMention1}`,
|
||||
categoryIds: ['cat8'],
|
||||
}),
|
||||
asTick.create('Post', {
|
||||
id: 'p9',
|
||||
categoryIds: ['cat9'],
|
||||
}),
|
||||
asTrick.create('Post', {
|
||||
id: 'p10',
|
||||
categoryIds: ['cat10'],
|
||||
}),
|
||||
asTrack.create('Post', {
|
||||
id: 'p11',
|
||||
image: faker.image.unsplash.people(),
|
||||
categoryIds: ['cat11'],
|
||||
}),
|
||||
asAdmin.create('Post', {
|
||||
id: 'p12',
|
||||
content: `${mention2} ${faker.lorem.paragraph()}`,
|
||||
categoryIds: ['cat12'],
|
||||
}),
|
||||
asModerator.create('Post', {
|
||||
id: 'p13',
|
||||
categoryIds: ['cat13'],
|
||||
}),
|
||||
asUser.create('Post', {
|
||||
id: 'p14',
|
||||
image: faker.image.unsplash.objects(),
|
||||
categoryIds: ['cat14'],
|
||||
}),
|
||||
asTick.create('Post', {
|
||||
id: 'p15',
|
||||
categoryIds: ['cat15'],
|
||||
}),
|
||||
])
|
||||
|
||||
await Promise.all([
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p0',
|
||||
to: 'cat16',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p1',
|
||||
to: 'cat1',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p2',
|
||||
to: 'cat2',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p3',
|
||||
to: 'cat3',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p4',
|
||||
to: 'cat4',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p5',
|
||||
to: 'cat5',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p6',
|
||||
to: 'cat6',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p7',
|
||||
to: 'cat7',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p8',
|
||||
to: 'cat8',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p9',
|
||||
to: 'cat9',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p10',
|
||||
to: 'cat10',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p11',
|
||||
to: 'cat11',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p12',
|
||||
to: 'cat12',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p13',
|
||||
to: 'cat13',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p14',
|
||||
to: 'cat14',
|
||||
}),
|
||||
f.relate('Post', 'Categories', {
|
||||
from: 'p15',
|
||||
to: 'cat15',
|
||||
}),
|
||||
|
||||
f.relate('Post', 'Tags', {
|
||||
from: 'p0',
|
||||
to: 'Freiheit',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user