PATCH not working Fix

This commit is contained in:
Jyotirmoy Bandyopadhayaya 2022-02-12 20:05:15 +05:30
parent 1bf4842d25
commit 4da7983945
2 changed files with 1203 additions and 1236 deletions

View File

@ -61,3 +61,17 @@ module.exports.deleteUrlData = async (req, res) => {
res.sendStaus(500)
})
}
module.exports.updateUrlData = async (req,res) =>{
//find a data object with url's id and update the alias
Minfy.findByIdAndUpdate(req.params.id, {'alias': req.body.alias})
.then((data)=>{
//send back the updated data object
res.send(data);
})
.catch((err)=>{
//found error
console.error(err)
res.sendStatus(500)
})
}

File diff suppressed because it is too large Load Diff