Notify all filing reporters in the seeding of the database

This commit is contained in:
Wolfgang Huß 2020-01-16 13:57:31 +01:00
parent c033260587
commit b02bc1c9bc

View File

@ -689,18 +689,21 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
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',
@ -708,6 +711,25 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
}),
reportAgainstDewey.relateTo(dewey, 'belongsTo'),
])
// notify first reports
await Promise.all([
reportAgainstDagobert.relateTo(jennyRostock, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
reportAgainstTrollingPost.relateTo(jennyRostock, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
reportAgainstTrollingComment.relateTo(huey, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
reportAgainstDewey.relateTo(dagobert, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
])
// report resource a second time
await Promise.all([
@ -717,6 +739,7 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
reasonDescription: 'this user is attacking me for who I am!',
}),
reportAgainstDagobert.relateTo(dagobert, 'belongsTo'),
reportAgainstTrollingPost.relateTo(peterLustig, 'filed', {
resourceId: 'p2',
reasonCategory: 'discrimination_etc',
@ -731,6 +754,21 @@ const languages = ['de', 'en', 'es', 'fr', 'it', 'pt', 'pl']
}),
reportAgainstTrollingComment.relateTo(trollingComment, 'belongsTo'),
])
// notify second reports
await Promise.all([
reportAgainstDagobert.relateTo(louie, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
reportAgainstTrollingPost.relateTo(peterLustig, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
reportAgainstTrollingComment.relateTo(bobDerBaumeister, 'notified', {
read: false,
reason: 'filed_report_on_resource',
}),
])
const disableVariables = {
resourceId: 'undefined-resource',