delete from DB by ID
This commit is contained in:
parent
38a532527a
commit
d271c70a9f
|
@ -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)
|
||||
})
|
||||
}
|
|
@ -7,4 +7,6 @@ router.get("/alias/:alias", controller.getURLData)
|
|||
|
||||
router.post("/add",controller.addURL)
|
||||
|
||||
router.delete('/delete/:id',controller.deleteUrlData)
|
||||
|
||||
module.exports = router;
|
2295
backend/yarn.lock
2295
backend/yarn.lock
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue