From 3451a16ab42271c329f905561b7b621985690459 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 21 Jun 2023 11:14:59 +0200 Subject: [PATCH 1/2] fix(backend): seed reports --- backend/src/db/seed.ts | 53 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/backend/src/db/seed.ts b/backend/src/db/seed.ts index 9eb67abbf..e0cc8ee07 100644 --- a/backend/src/db/seed.ts +++ b/backend/src/db/seed.ts @@ -1100,7 +1100,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] huey.relateTo(p9, 'shouted'), louie.relateTo(p10, 'shouted'), ]) - + const reports = await Promise.all([ Factory.build('report'), Factory.build('report'), @@ -1113,32 +1113,31 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] const reportAgainstDewey = reports[3] // report resource first time - await Promise.all([ - reportAgainstDagobert.relateTo(jennyRostock, 'filed', { - resourceId: 'u7', - reasonCategory: 'discrimination_etc', - reasonDescription: 'This user is harassing me with bigoted remarks!', - }), - reportAgainstDagobert.relateTo(dagobert, 'belongsTo'), - reportAgainstTrollingPost.relateTo(jennyRostock, 'filed', { - resourceId: 'p2', - reasonCategory: 'doxing', - reasonDescription: "This shouldn't be shown to anybody else! It's my private thing!", - }), - reportAgainstTrollingPost.relateTo(p2, 'belongsTo'), - reportAgainstTrollingComment.relateTo(huey, 'filed', { - resourceId: 'c1', - reasonCategory: 'other', - reasonDescription: 'This comment is bigoted', - }), - reportAgainstTrollingComment.relateTo(trollingComment, 'belongsTo'), - reportAgainstDewey.relateTo(dagobert, 'filed', { - resourceId: 'u5', - reasonCategory: 'discrimination_etc', - reasonDescription: 'This user is harassing me!', - }), - reportAgainstDewey.relateTo(dewey, 'belongsTo'), - ]) + + await reportAgainstDagobert.relateTo(jennyRostock, 'filed', { + resourceId: 'u7', + reasonCategory: 'discrimination_etc', + reasonDescription: 'This user is harassing me with bigoted remarks!', + }) + await reportAgainstDagobert.relateTo(dagobert, 'belongsTo') + await reportAgainstTrollingPost.relateTo(jennyRostock, 'filed', { + resourceId: 'p2', + reasonCategory: 'doxing', + reasonDescription: "This shouldn't be shown to anybody else! It's my private thing!", + }) + await reportAgainstTrollingPost.relateTo(p2, 'belongsTo') + await reportAgainstTrollingComment.relateTo(huey, 'filed', { + resourceId: 'c1', + reasonCategory: 'other', + reasonDescription: 'This comment is bigoted', + }) + await reportAgainstTrollingComment.relateTo(trollingComment, 'belongsTo') + await reportAgainstDewey.relateTo(dagobert, 'filed', { + resourceId: 'u5', + reasonCategory: 'discrimination_etc', + reasonDescription: 'This user is harassing me!', + }) + await reportAgainstDewey.relateTo(dewey, 'belongsTo') // report resource a second time await Promise.all([ From ed9fefbf76d902dbb519d364f12f3ffba01df4a7 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 21 Jun 2023 17:59:20 +0200 Subject: [PATCH 2/2] Update backend/src/db/seed.ts Co-authored-by: Ulf Gebhardt --- backend/src/db/seed.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/db/seed.ts b/backend/src/db/seed.ts index e0cc8ee07..d594f4852 100644 --- a/backend/src/db/seed.ts +++ b/backend/src/db/seed.ts @@ -1100,7 +1100,6 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl'] huey.relateTo(p9, 'shouted'), louie.relateTo(p10, 'shouted'), ]) - const reports = await Promise.all([ Factory.build('report'), Factory.build('report'),