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

#161280586 user can get an authors article
 #44

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

joeeasy
Copy link
Contributor

@joeeasy joeeasy commented Oct 17, 2018

What does this PR do?

Add an endpoint for fetching author's articles

Description of Task to be completed?

  • Created /authors/articles/:authorId route to return all the articles the author has created

How should this be manually tested?

Clone the repo, run npm install; using postman, hit the /api/v1/authors/articles/:authorId endpoint

What are the relevant pivotal tracker stories?

#161280586

@@ -1,4 +1,9 @@
import GetAuthorsOfTheWeekHelpers from '../helpers/GetAuthorsOfTheWeekHelpers';
import models from '../models';
import helpers from '../helpers/helpers';

Choose a reason for hiding this comment

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

Missing file extension for "../helpers/helpers" import/extensions

@@ -1,4 +1,9 @@
import GetAuthorsOfTheWeekHelpers from '../helpers/GetAuthorsOfTheWeekHelpers';
import models from '../models';

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

@@ -2,6 +2,7 @@ import chai from 'chai';
import chaiHttp from 'chai-http';
import app from '../server/app';
import GetAuthorsOfTheWeekHelpers from '../server/helpers/GetAuthorsOfTheWeekHelpers';
import generateToken from '../server/helpers/generateToken';

Choose a reason for hiding this comment

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

Missing file extension for "../server/helpers/generateToken" import/extensions

@@ -1,9 +1,12 @@
import express from 'express';
import authorController from '../controllers/authorController';
import authorController, { getArticlesByAuthorsId } from '../controllers/authorController';

Choose a reason for hiding this comment

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

Missing file extension for "../controllers/authorController" import/extensions

@coveralls
Copy link

coveralls commented Oct 17, 2018

Pull Request Test Coverage Report for Build 621

  • 14 of 15 (93.33%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 93.954%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server/controllers/authorController.js 8 9 88.89%
Files with Coverage Reduction New Missed Lines %
server/controllers/articleController.js 1 91.46%
Totals Coverage Status
Change from base Build 558: -0.2%
Covered Lines: 900
Relevant Lines: 952

💛 - Coveralls

@joeeasy joeeasy force-pushed the ft-user-can-view-author-article-#161280586 branch from c7f50f4 to 82715ac Compare October 17, 2018 12:13
@@ -1,9 +1,13 @@
import express from 'express';
import authorController from '../controllers/authorController';
import authorController, { getArticlesByAuthorsId } from '../controllers/authorController';
import auth from '../middleware/auth';

Choose a reason for hiding this comment

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

Missing file extension for "../middleware/auth" import/extensions

message: 'All articles',
articles
})
: res.status(404).jsend.success({
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's return an empty array if no articles are present

Copy link
Contributor

Choose a reason for hiding this comment

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

Status 200

- Users can view the articles of an author
[finishes #161280586]
@joeeasy joeeasy force-pushed the ft-user-can-view-author-article-#161280586 branch from 82715ac to 68f6e9d Compare October 17, 2018 12:29
@iAmao iAmao merged commit 13d3a6e into develop Oct 17, 2018
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

4 participants