From 4b1fa26bc5bd870d7dfe81f3700395b48316ee6a Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 26 Jul 2023 16:35:05 +0200 Subject: [PATCH] more console logs --- .../notifications/notificationsMiddleware.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/middleware/notifications/notificationsMiddleware.ts b/backend/src/middleware/notifications/notificationsMiddleware.ts index e5608a4d7..f41ff4d38 100644 --- a/backend/src/middleware/notifications/notificationsMiddleware.ts +++ b/backend/src/middleware/notifications/notificationsMiddleware.ts @@ -53,10 +53,10 @@ const publishNotifications = async (context, promises) => { } const notifyPublishUsersOfMentionInclAll = async (label, id, idsOfUsers, reason, context) => { - console.log('notifyPublishUsersOfMentionInclAll – idsOfUsers: ', label) - console.log('notifyPublishUsersOfMentionInclAll – idsOfUsers: ', id) + console.log('notifyPublishUsersOfMentionInclAll – label: ', label) + console.log('notifyPublishUsersOfMentionInclAll – id: ', id) console.log('notifyPublishUsersOfMentionInclAll – idsOfUsers: ', idsOfUsers) - console.log('notifyPublishUsersOfMentionInclAll – idsOfUsers: ', reason) + console.log('notifyPublishUsersOfMentionInclAll – reason: ', reason) if (idsOfUsers.find((id) => id === 'all')) { if (context.user.role !== 'admin') throw new AuthenticationError('You are not allowed to use the "@all" mention!') @@ -131,7 +131,8 @@ const handleRemoveUserFromGroup = async (resolve, root, args, context, resolveIn } const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo) => { - const idsOfUsers = await extractMentionedUsers(args.content) + const idsOfUsers = extractMentionedUsers(args.content) + console.log('handleContentDataOfPost', idsOfUsers) const post = await resolve(root, args, context, resolveInfo) if (post) { await notifyPublishUsersOfMentionInclAll( @@ -147,7 +148,8 @@ const handleContentDataOfPost = async (resolve, root, args, context, resolveInfo const handleContentDataOfComment = async (resolve, root, args, context, resolveInfo) => { const { content } = args - let idsOfUsers = await extractMentionedUsers(content) + let idsOfUsers = extractMentionedUsers(content) + console.log('handleContentDataOfComment', idsOfUsers) const comment = await resolve(root, args, context, resolveInfo) const [postAuthor] = await postAuthorOfComment(comment.id, { context }) console.log('handleContentDataOfComment – before filter – postAuthor.id: ', postAuthor.id) @@ -310,6 +312,7 @@ const notifyUsersOfMention = async (label, id, idsOfUsers, reason, context) => { }) try { const notifications = await writeTxResultPromise + console.log(notifications) return notifications } catch (error) { throw new Error(error) @@ -346,6 +349,7 @@ const notifyUsersOfComment = async (label, commentId, postAuthorId, reason, cont }) try { const notifications = await writeTxResultPromise + console.log(notifications) return notifications } finally { session.close()