Skip to content
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

Merged
merged 1 commit into from
Aug 29, 2019

Conversation

dharmykoya
Copy link
Contributor

What does this PR do?

To allow users to receive a notification when other users publish an article

Description of Task to be completed?

  • create a function to notify users when a user they are following publishes an article

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

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'
Copy link

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',
Copy link

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'
Copy link

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',
Copy link

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';
Copy link

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;
Copy link

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';
Copy link

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'],
Copy link

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'],
Copy link

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';
Copy link

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

Copy link
Contributor

@devPinheiro devPinheiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@tunedev tunedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devPinheiro devPinheiro merged commit e092620 into develop Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants