-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add functionality to get all users #27
Conversation
…profiles of existing authors Files modify/create: - modify userController file - modify user routes - modify user.test.js Start #160451510
Pull Request Test Coverage Report for Build 268
💛 - Coveralls |
@@ -19,7 +19,7 @@ export default class LikeController { | |||
const dislike = req.params.likeType === 'dislike'; | |||
// message to be sent to user depending on function performed | |||
const message = like || dislike ? `you ${req.params.likeType}d the article` | |||
: 'you disliked the article'; | |||
: 'you unliked the article'; |
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.
I edited the like controller to fix a bug of not disliking an article after liking that particular article.
…451510/list-users
@@ -1,6 +1,6 @@ | |||
[![Build Status](https://travis-ci.org/andela/phlox-ah.svg?branch=master)](https://travis-ci.org/andela/phlox-ah) | |||
[![Validated by Hound](https://img.shields.io/badge/Validated_By-Hound_CI-06576D.svg)](https://houndci.com) | |||
[![Coverage Status](https://coveralls.io/repos/github/andela/phlox-ah/badge.svg?branch=chore%2F160451494%2Fintegrate-coveralls)](https://coveralls.io/github/andela/phlox-ah?branch=chore%2F160451494%2Fintegrate-coveralls) | |||
[![Coverage Status](https://coveralls.io/repos/github/andela/phlox-ah/badge.svg?branch=chore%2F160451494%2Fintegrate-coveralls)](https://coveralls.io/github/andela/phlox-ah?branch=staging) |
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.
here. I changed the targetted branch that the coveralls badge uses to staging
server/models/user.js
Outdated
@@ -81,7 +81,7 @@ export default (sequelize, DataTypes) => { | |||
foreignKey: 'userId', | |||
as: 'likes' | |||
}); | |||
User.hasOne(models.Profile, { | |||
User.hasMany(models.Profile, { |
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.
I changed this relationship to hasMany because I couldn't get sourceKey to work using hasOne. I searched and saw that hasOne does not support sourceKey
…451510/list-users
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
…451510/list-users
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?
This PR creates functionality for a user to see the list and profiles of existing authors
Description of Task to be completed?
How should this be manually tested?
GET /api/v1/users
GET /api/v1/users/:username
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#160451510