This commit is contained in:
Christopher Cookman 2026-07-30 21:59:39 -06:00
parent bc21403ba2
commit 68eae26625

View file

@ -403,6 +403,7 @@ app.put('/api/v1/admin/route/:id', (req, res) => { // Update a route
res.status(404).json({ error: 'Not Found' }); res.status(404).json({ error: 'Not Found' });
return; return;
} }
console.log(req.body)
// Update route // Update route
const server = req.body.server || row.server; const server = req.body.server || row.server;
const port = req.body.port || row.port; const port = req.body.port || row.port;
@ -415,12 +416,6 @@ app.put('/api/v1/admin/route/:id', (req, res) => { // Update a route
conn.query('UPDATE routes SET server = ?, port = ?, auth = ?, secret = ?, block_start = ?, block_length = ?, contact = ? WHERE id = ?', conn.query('UPDATE routes SET server = ?, port = ?, auth = ?, secret = ?, block_start = ?, block_length = ?, contact = ? WHERE id = ?',
[server, port, auth, secret, block_start, block_length, contact, req.params.id]).then(async () => { [server, port, auth, secret, block_start, block_length, contact, req.params.id]).then(async () => {
res.json({ message: 'Updated' }); res.json({ message: 'Updated' });
const rows = await conn.query(
'SELECT secret FROM routes WHERE id = ?',
[req.params.id]
);
console.log('DB secret:', rows[0].secret);
}).catch(err => { }).catch(err => {
console.error('Error updating route:', err); console.error('Error updating route:', err);
res.status(500).json({ error: 'Internal server error' }); res.status(500).json({ error: 'Internal server error' });