Update IP fixed

This commit is contained in:
ecki
2026-03-28 15:04:30 +01:00
parent 013be5c201
commit 162253c753
3 changed files with 26 additions and 18 deletions
+1 -17
View File
@@ -11,27 +11,11 @@ router.post("/resources/:id/ips", controller.create);
/* delete IP */
router.delete("/ips/:id", controller.remove);
router.put("/ips/:id", async (req, res) => {
try{
router.put("/ips/:id", controller.update);
const {ip, type, comment} = req.body
await db.query(
"UPDATE resource_ips SET ip=?, type=?, comment=? WHERE id=?",
[ip, type, comment, req.params.id]
)
res.json({success:true})
}catch(e){
console.error("UPDATE IP error:", e)
res.status(500).json({error:"DB error"})
}
})
module.exports = router;