Subdomain edit funktion eingebaut
This commit is contained in:
@@ -85,6 +85,30 @@ res.status(500).json({error:"DB error"})
|
||||
|
||||
})
|
||||
|
||||
router.put("/:id", async (req,res)=>{
|
||||
|
||||
try{
|
||||
|
||||
const {subdomain, ip_address} = req.body
|
||||
|
||||
await db.query(`
|
||||
UPDATE subdomains
|
||||
SET subdomain=?, ip_address=?
|
||||
WHERE id=?
|
||||
`,[subdomain, ip_address, req.params.id])
|
||||
|
||||
res.json({success:true})
|
||||
|
||||
}catch(e){
|
||||
|
||||
console.error("UPDATE subdomain error:",e)
|
||||
res.status(500).json({error:"DB error"})
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
module.exports = router
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user