diff --git a/backend/src/schema/types/schema.gql b/backend/src/schema/types/schema.gql index 492dd3966..40d8239b8 100644 --- a/backend/src/schema/types/schema.gql +++ b/backend/src/schema/types/schema.gql @@ -55,6 +55,7 @@ type Notification { read: Boolean user: User @relation(name: "NOTIFIED", direction: "OUT") post: Post @relation(name: "NOTIFIED", direction: "IN") + comment: Post @relation(name: "NOTIFIED", direction: "IN") createdAt: String } diff --git a/backend/src/seed/seed-db.js b/backend/src/seed/seed-db.js index 188336572..f1c88899f 100644 --- a/backend/src/seed/seed-db.js +++ b/backend/src/seed/seed-db.js @@ -2,7 +2,8 @@ import faker from 'faker' import Factory from './factories' /* eslint-disable no-multi-spaces */ -;(async function() { +; +(async function () { try { const f = Factory() const [racoon, rabbit, wolf, bear, turtle, rhino] = await Promise.all([ @@ -297,6 +298,8 @@ import Factory from './factories' const mention1 = 'Hey @jenny-rostock, what\'s up?' const mention2 = 'Hey @jenny-rostock, here is another notification for you!' + const hashtag1 = 'See #NaturphilosophieYoga can really help you!' + const hashtagAndMention1 = 'The new physics of #QuantenFlussTheorie can explain #QuantumGravity! @peter-lustig got that already. ;-)' await Promise.all([ asAdmin.create('Post', { @@ -309,6 +312,8 @@ import Factory from './factories' }), asUser.create('Post', { id: 'p2', + title: `Nature Philosophy Yoga`, + content: `${hashtag1}`, }), asTick.create('Post', { id: 'p3', @@ -330,6 +335,8 @@ import Factory from './factories' asUser.create('Post', { id: 'p8', image: faker.image.unsplash.nature(), + title: `Quantum Flow Theory explains Quantum Gravity`, + content: `${hashtagAndMention1}`, }), asTick.create('Post', { id: 'p9', @@ -566,6 +573,9 @@ import Factory from './factories' }), ]) + const mentionInComment1 = 'I heard @jenny-rostock, practice it since 3 years now.' + const mentionInComment2 = 'Did @peter-lustig told you?' + await Promise.all([ asUser.create('Comment', { id: 'c1', @@ -582,6 +592,12 @@ import Factory from './factories' asTrick.create('Comment', { id: 'c4', postId: 'p2', + content: `${mentionInComment1}`, + }), + asUser.create('Comment', { + id: 'c4-1', + postId: 'p2', + content: `${mentionInComment2}`, }), asModerator.create('Comment', { id: 'c5', @@ -692,4 +708,4 @@ import Factory from './factories' process.exit(1) } })() -/* eslint-enable no-multi-spaces */ +/* eslint-enable no-multi-spaces */ \ No newline at end of file