Skip to content

Commit a50da8c

Browse files
authored
Update controller.js
1 parent 9163862 commit a50da8c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

CRUD API's/app/controllers/controller.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ exports.findbytitle=function(req,res){
7676
//update any note with given id
7777
exports.update=function(req,res){
7878

79-
if(!req.body.content){
80-
return res.status(400).send({message :"Note content can not be empty"})
79+
if(!req.body.title||!req.body.author||!req.body.content) {
80+
return res.status(400).send({
81+
message: "Every field is required"
82+
});
8183
}
8284

8385
Note.findByIdAndUpdate(req.params.noteId,{
@@ -110,4 +112,4 @@ exports.delete=function(req,res){
110112
});
111113
})
112114

113-
};
115+
};

0 commit comments

Comments
 (0)