|
|
@ -35,7 +35,7 @@ router.get("/:fqdn/:code", (req, res) => {
|
|
|
|
if (!["ipv4", "ipv6"].includes(addr.kind())) return res.status(400).send("Invalid ip address");
|
|
|
|
if (!["ipv4", "ipv6"].includes(addr.kind())) return res.status(400).send("Invalid ip address");
|
|
|
|
db.query("UPDATE addresses SET " + addr.kind() + " = ? WHERE fqdn = ? AND code = ?", [addr.toString(), req.params.fqdn, req.params.code], (e, d) => {
|
|
|
|
db.query("UPDATE addresses SET " + addr.kind() + " = ? WHERE fqdn = ? AND code = ?", [addr.toString(), req.params.fqdn, req.params.code], (e, d) => {
|
|
|
|
if (e) return res.status(400).send("Error");
|
|
|
|
if (e) return res.status(400).send("Error");
|
|
|
|
res.send(d);
|
|
|
|
res.send(addr.toString());
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|