-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#168191815 bug fix to notify users when article is published #53
Conversation
To allow users receive notification when other users they are following publish an article [#168191815]
@@ -163,7 +163,7 @@ describe('Notification service', () => { | |||
userId: userIdC, | |||
likeUserId: userIdA, | |||
articleSlug: | |||
'/articles/temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam/comments/2' | |||
'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam'
with "temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam"
prettier/prettier
@@ -146,7 +146,7 @@ describe('Notification service', () => { | |||
userId: userIdC, | |||
commentUserId: userIdB, | |||
articleSlug: | |||
'/articles/temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam/comments/2', | |||
'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam'
with "temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam"
prettier/prettier
@@ -80,7 +80,7 @@ describe('Notification service', () => { | |||
userId: userIdA, | |||
likeUserId: userIdB, | |||
articleSlug: | |||
'/articles/temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam/comments/2' | |||
'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam'
with "temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam"
prettier/prettier
@@ -63,7 +63,7 @@ describe('Notification service', () => { | |||
userId: userIdA, | |||
commentUserId: userIdB, | |||
articleSlug: | |||
'/articles/temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam/comments/2', | |||
'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam'
with "temporibus-labore-laborum-repudiandae-vitae-rerum-debitis-ut-quidem-quisquam"
prettier/prettier
@@ -5,6 +5,7 @@ import Helper from './helper'; | |||
import model from '../db/models'; | |||
import { paginationQueryMetadata, pageMetadata } from '../helpers/pagination'; | |||
import { sendWelcomeEmail } from '../helpers/mail.helper'; | |||
import { followNotification } from './notification.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace './notification.service'
with "./notification.service"
prettier/prettier
|
||
dotenv.config(); | ||
|
||
const { Notification } = models; | ||
const { Notification, Follow } = models; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Follow' is assigned a value but never used no-unused-vars
@@ -2,10 +2,11 @@ import Pusher from 'pusher'; | |||
import dotenv from 'dotenv'; | |||
import models from '../db/models'; | |||
import { findUserById } from './auth.service'; | |||
import { getUserFollowersService } from './user.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace './user.service'
with "./user.service"
prettier/prettier
@@ -471,6 +481,14 @@ export const createCommentService = async (userId, slug, commentDetails) => { | |||
highlightedText: highlightedText || null | |||
}); | |||
|
|||
const details = { | |||
userId: article['author.id'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'author.id'
with "author.id"
prettier/prettier
@@ -442,7 +452,7 @@ export const createCommentService = async (userId, slug, commentDetails) => { | |||
{ | |||
model: User, | |||
as: 'author', | |||
attributes: ['firstName', 'lastName'], | |||
attributes: ['id', 'firstName', 'lastName'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace 'id',·'firstName',·'lastName'
with "id",·"firstName",·"lastName"
prettier/prettier
commentArticleNotification, | ||
likeCommentNotification, | ||
sendNotificationOnArticlePublish | ||
} from './notification.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace './notification.service'
with "./notification.service"
prettier/prettier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
To allow users to receive a notification when other users publish an article
Description of Task to be completed?
How should this be manually tested?
N/A
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#168191815
Screenshots (if appropriate)
N/A
Questions:
N/A