IP Manager überarbeitet

This commit is contained in:
ecki
2026-03-27 14:50:03 +01:00
parent 0329c67904
commit 89ce86eb4a
7 changed files with 275 additions and 13 deletions
+23
View File
@@ -11,4 +11,27 @@ router.post("/resources/:id/ips", controller.create);
/* delete IP */
router.delete("/ips/:id", controller.remove);
router.put("/ips/:id", async (req, res) => {
try{
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;