This commit is contained in:
Wolfgang Huß 2020-04-01 15:52:24 +02:00
parent 0d690e1a6a
commit d0cf1cc185
6 changed files with 13 additions and 13 deletions

View File

@ -49,7 +49,7 @@ const postAuthorOfComment = async (commentId, { context }) => {
{ commentId },
)
})
return postAuthorId.records.map(record => record.get('authorId'))
return postAuthorId.records.map((record) => record.get('authorId'))
} catch (error) {
debug(error)
} finally {
@ -98,14 +98,14 @@ const notifyUsersOfMention = async (label, id, idsOfUsers, reason, context) => {
RETURN notification {.*, from: finalResource, to: properties(user)}
`
const session = context.driver.session()
const writeTxResultPromise = session.writeTransaction(async transaction => {
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
const notificationsTransactionResponse = await transaction.run(mentionedCypher, {
id,
idsOfUsers,
reason,
})
log(notificationsTransactionResponse)
return notificationsTransactionResponse.records.map(record => record.get('notification'))
return notificationsTransactionResponse.records.map((record) => record.get('notification'))
})
try {
const notifications = await writeTxResultPromise
@ -121,7 +121,7 @@ const notifyUsersOfComment = async (label, commentId, postAuthorId, reason, cont
if (context.user.id === postAuthorId) return []
await validateNotifyUsers(label, reason)
const session = context.driver.session()
const writeTxResultPromise = await session.writeTransaction(async transaction => {
const writeTxResultPromise = await session.writeTransaction(async (transaction) => {
const notificationsTransactionResponse = await transaction.run(
`
MATCH (postAuthor:User {id: $postAuthorId})-[:WROTE]->(post:Post)<-[:COMMENTS]-(comment:Comment { id: $commentId })<-[:WROTE]-(commenter:User)
@ -137,7 +137,7 @@ const notifyUsersOfComment = async (label, commentId, postAuthorId, reason, cont
{ commentId, postAuthorId, reason },
)
log(notificationsTransactionResponse)
return notificationsTransactionResponse.records.map(record => record.get('notification'))
return notificationsTransactionResponse.records.map((record) => record.get('notification'))
})
try {
const notifications = await writeTxResultPromise
@ -164,7 +164,7 @@ const handleFileReport = async (resolve, root, args, context, resolveInfo) => {
const notifyReportFiler = async (reportId, resourceId, context) => {
const { driver, user } = context
const session = driver.session()
const writeTxResultPromise = await session.writeTransaction(async transaction => {
const writeTxResultPromise = await session.writeTransaction(async (transaction) => {
const notificationsTransactionResponse = await transaction.run(
`
MATCH (resource {id: $resourceId})<-[:BELONGS_TO]-(report:Report {id: $reportId})<-[filed:FILED]-(submitter:User {id: $submitterId})
@ -185,7 +185,7 @@ const notifyReportFiler = async (reportId, resourceId, context) => {
},
)
log(notificationsTransactionResponse)
return notificationsTransactionResponse.records.map(record => record.get('notification'))
return notificationsTransactionResponse.records.map((record) => record.get('notification'))
})
try {
const [notification] = await writeTxResultPromise

View File

@ -656,7 +656,7 @@ describe('notifications', () => {
})
authenticatedUser = await notifiedUser.toJson()
}
const setExpectedNotificationOfReportedResource = resource => {
const setExpectedNotificationOfReportedResource = (resource) => {
return expect.objectContaining({
data: {
notifications: [

View File

@ -135,12 +135,12 @@ export default {
// $ {offset} $ {limit}
`
const readTxResultPromise = session.readTransaction(async transaction => {
const readTxResultPromise = session.readTransaction(async (transaction) => {
const notificationsTransactionResponse = await transaction.run(cypher, {
id: currentUser.id,
})
log(notificationsTransactionResponse)
const notifications = notificationsTransactionResponse.records.map(record =>
const notifications = notificationsTransactionResponse.records.map((record) =>
record.get('notification'),
)
return notifications

View File

@ -117,7 +117,7 @@
<span
v-if="
notificationData.report.reasonDescription &&
notificationData.report.reasonDescription !== ''
notificationData.report.reasonDescription !== ''
"
>
{{ notificationData.report.reasonDescription }}

View File

@ -160,7 +160,7 @@ describe('NotificationsTable.vue', () => {
it('renders the reason for the notification', () => {
const dsTexts = thirdRowNotification.findAll('.ds-text')
const reason = dsTexts.filter(
element => element.text() === 'notifications.reason.filed_report_on_resource.user',
(element) => element.text() === 'notifications.reason.filed_report_on_resource.user',
)
expect(reason.exists()).toBe(true)
})

View File

@ -107,7 +107,7 @@ export default {
}
},
notificationsData() {
return this.notifications.map(notification =>
return this.notifications.map((notification) =>
extractNotificationDataOfCurrentUser(notification, this.currentUser),
)
},