ResMan update

This commit is contained in:
ecki
2026-03-09 17:31:29 +01:00
parent 2757db3268
commit 6a8f26f60d
2 changed files with 24 additions and 16 deletions
+17 -7
View File
@@ -54,14 +54,24 @@ router.get('/:id', async (req, res) => {
// CREATE DOMAIN
router.post('/', async (req, res) => {
try {
const { domain_name, provider, ip_address, yearly_cost, notes } = req.body;
const [result] = await pool.query(
`INSERT INTO domains
(domain_name, provider, ip_address, yearly_cost, notes)
VALUES (?, ?, ?, ?, ?)`,
[domain_name, provider, ip_address, yearly_cost, notes]
);
const { domain_name, provider, ip_address, yearly_cost, notes } = req.body;
await pool.query(
`INSERT INTO domains
(domain_name, provider, ip_address, yearly_cost, notes)
VALUES (?, ?, ?, ?, ?)`,
[
domain_name,
provider,
ip_address,
yearly_cost || null,
notes
]
);
res.json({
message: "Domain created",