-
Notifications
You must be signed in to change notification settings - Fork 1
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
#159987415 implement article read time #33
base: develop
Are you sure you want to change the base?
Conversation
test/articles.spec.js
Outdated
.set('authorization', hashedToken) | ||
.send() | ||
.end((err, res) => { | ||
console.log(res.body); |
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 console statement no-console
test/articles.spec.js
Outdated
.set('authorization', hashedToken) | ||
.send() | ||
.end((err, res) => { | ||
console.log(res.body); |
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 console statement no-console
5b585bf
to
4ad88e7
Compare
Pull Request Test Coverage Report for Build 489
💛 - Coveralls |
- Add wordsPerMinute column to the user model - Add number of words column to the article model - create function for calculating read time - add beforeValidate hook to calculate noOfWords in the article model [Finishes #159987415]
4ad88e7
to
84ede4c
Compare
Check your PR title |
* @returns {string} read time of an article | ||
*/ | ||
const readTime = async (userId, article) => { | ||
// Number of words in 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.
It is very good practice to comment your codes, nevertheless, you may also want to avoid redundant comment to keep best practices.
Moving forward you may want to check out this site https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--net-8118 to learn more on best practices.
Aside from this, you did a very good job. Nice one 👍
Thanks
…On Mon, 24 Sep 2018 at 12:00 AM, DanielAdek ***@***.***> wrote:
***@***.**** approved this pull request.
------------------------------
In server/helpers/readTime.js
<#33 (comment)>:
> @@ -0,0 +1,20 @@
+import models from '../models';
+
+const { Users } = models;
+/**
+ * @description This method calculates the read of an article
+ * @param {integer} userId The id of the user getting the article
+ * @param {object} article The article object
+ * @returns {string} read time of an article
+ */
+const readTime = async (userId, article) => {
+ // Number of words in the article
It is very good practice to comment your codes, nevertheless, you may also
want to avoid redundant comment to keep best practices.
Moving forward you may want to check out this site
https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--net-8118
to learn more on best practices.
Aside from this, you did a very good job. Nice one 👍
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AUiJfIHZNDo4-NGD0RCa0-S42zaiLIwKks5ueBJ4gaJpZM4WzuYt>
.
|
What does this PR do?
implement article read time
Description of Task to be completed?
How should this be manually tested?
ft-article-read-time-159987415
branch.localhost:8000/api/v1/articles/:articleId
What are the relevant pivotal tracker stories?
#159987415