-
Notifications
You must be signed in to change notification settings - Fork 4
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
#159987711 users should be able to follow each other #33
#159987711 users should be able to follow each other #33
Conversation
- add unit test for user-follow model - add unit tests for user-follow endpoints - add follow a user endpoint - add get all followings endpoint - add get all followers endpoint - add unfollow user endpoint [Finishes #159987711
checkModelName, | ||
checkPropertyExists | ||
} from 'sequelize-test-helpers'; | ||
import userFollowModel from '../../models/userFollow'; |
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.
Missing file extension for "../../models/userFollow" import/extensions
dataTypes, | ||
checkModelName, | ||
checkPropertyExists | ||
} from 'sequelize-test-helpers'; |
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.
Missing file extension for "sequelize-test-helpers" import/extensions
@@ -0,0 +1,28 @@ | |||
import chai from 'chai'; | |||
import chaiHttp from 'chai-http'; |
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.
Missing file extension for "chai-http" import/extensions
@@ -0,0 +1,28 @@ | |||
import chai from 'chai'; |
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.
Missing file extension for "chai" import/extensions
@@ -1,2 +1,3 @@ | |||
import './user.model.test'; | |||
import './article'; | |||
import './userFollow'; |
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.
Missing file extension for "./userFollow" import/extensions
@@ -2,6 +2,7 @@ import { Router } from 'express'; | |||
import articlesRouter from './articles'; | |||
|
|||
import userRoutes from './users'; | |||
import userFollowRoutes from './userFollows'; |
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.
Missing file extension for "./userFollows" import/extensions
} | ||
}); | ||
}, | ||
down: (queryInterface, Sequelize) => { |
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.
'Sequelize' is defined but never used no-unused-vars
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>
arrow-body-style
@@ -0,0 +1,30 @@ | |||
'use strict'; | |||
module.exports = { | |||
up: (queryInterface, Sequelize) => { |
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.
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>
arrow-body-style
@@ -0,0 +1,30 @@ | |||
'use strict'; |
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.
Expected newline after "use strict" directive lines-around-directive
'use strict' is unnecessary inside of modules strict
@@ -0,0 +1,156 @@ | |||
import db from '../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.
Missing file extension for "../models" import/extensions
Pull Request Test Coverage Report for Build 234
💛 - Coveralls |
- add unit test for user-follow model - add unit tests for user-follow endpoints - add follow a user endpoint - add get all followings endpoint - add get all followers endpoint - add unfollow user endpoint [Finishes #159987711
17bd9b0
to
1fadf04
Compare
- change SECRET to JWT_KEY in email verification [#159987711]
1fadf04
to
099782e
Compare
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
server/controllers/userFollows.js
Outdated
|
||
/** | ||
* @static | ||
* @param {reuest} req |
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.
On line 62, I believe this should be @param {object} req or whatever datatype you think you are dealing with for that parameter. Check also for line 86.
server/controllers/userFollows.js
Outdated
if (!user) { | ||
return res.status(404).json({ | ||
errors: { | ||
message: 'User you are not following this user', |
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.
On line 62, The message should be 'You are not following this user'
What does this PR do?
implement CRUD functionalities of user-follow feature
Description of Task to be completed?
create user-follow model
unit test user-follow model
add create user-follow endpoint
add get all followers endpoint
add get all followings endpoint
add unfollow endpoint
unit test user-follow endpoints
How should this be manually tested?
Run 'npm install'
create a .env using the .env.sample template
Run 'npm run migrate'
Run 'npm run start:dev'
use postman to test:
post: /api/users/follow, get: /api/users/followers, get: /api/users/followings
and delete: /api/users/unfollow endpoints
What are the relevant pivotal tracker stories?
#159987711