We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9163862 commit a50da8cCopy full SHA for a50da8c
CRUD API's/app/controllers/controller.js
@@ -76,8 +76,10 @@ exports.findbytitle=function(req,res){
76
//update any note with given id
77
exports.update=function(req,res){
78
79
- if(!req.body.content){
80
- return res.status(400).send({message :"Note content can not be empty"})
+ if(!req.body.title||!req.body.author||!req.body.content) {
+ return res.status(400).send({
81
+ message: "Every field is required"
82
+ });
83
}
84
85
Note.findByIdAndUpdate(req.params.noteId,{
@@ -110,4 +112,4 @@ exports.delete=function(req,res){
110
112
});
111
113
})
114
-};
115
+};
0 commit comments