delete from DB by ID

This commit is contained in:
XxThunderBlastxX 2022-02-01 20:40:46 +05:30
parent 38a532527a
commit d271c70a9f
3 changed files with 1137 additions and 1171 deletions

View File

@ -23,4 +23,15 @@ module.exports.addURL = async (req, res) => {
console.error(err)
res.sendStaus(500)
})
}
module.exports.deleteUrlData = async (req,res) =>{
Minfy.findByIdAndRemove(req.params.id)
.then((data)=>{
res.send("Successfully Deleted")
})
.catch((err)=>{
console.error(err)
res.sendStaus(500)
})
}

View File

@ -7,4 +7,6 @@ router.get("/alias/:alias", controller.getURLData)
router.post("/add",controller.addURL)
router.delete('/delete/:id',controller.deleteUrlData)
module.exports = router;

File diff suppressed because it is too large Load Diff