ResMan update
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user