Skip to content

Conversation

@anandbhardwaj1
Copy link

@anandbhardwaj1 anandbhardwaj1 commented Aug 9, 2020

Title and other contents always required.
Added Feedback Model which will help readers to go through the best content first i.e blogs are arranged according to their overall ratings.

Motivation

(Write your motivation here.)

Have you read the Contributing Guidelines on issues?

yes

Test Plan

i have tested on my local server.

Related PRs and Issues

#16
#12

title and content always required.
@parasg1999
Copy link

Could you please update the PR according to the template?

default rating is zero.
star rating system
update rating and sort the blog according to the feedback
added feedback button
@anandbhardwaj1 anandbhardwaj1 changed the title Update postStory.ejs Added Feedback system to the Blog Aug 17, 2020
console.log(errors);
if (!errors.isEmpty()) {

res.send(500);
Copy link
Member

@vaibhavrajsingh2001 vaibhavrajsingh2001 Aug 25, 2020

Choose a reason for hiding this comment

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

Errors are sent with a message in this format:

return res.status(400).json({ msg: 'Empty request' });

// console.log(req.body.nodes[0].content);

}
else{

Choose a reason for hiding this comment

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

Use try and catch blocks for error handling btw. This helps in sending error responses for all sorts of errors, instead of sending individual response for particular errors.

});


router.get("/posterror", function (req, res) {

Choose a reason for hiding this comment

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

Don't write a separate route just for errors. Errors should be written for each individual route.

{upsert:false},

function(err, document){

Choose a reason for hiding this comment

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

You can write a simple console.log here cause otherwise there's no purpose of an error handling function.

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.

3 participants