Im not wearing my glasses :)
This commit is contained in:
parent
7ab82123ba
commit
852d9e20e5
6
index.js
6
index.js
|
|
@ -407,14 +407,14 @@ app.put('/api/v1/admin/route/:id', (req, res) => { // Update a route
|
||||||
// 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;
|
||||||
const auth = req.body.apiKey || row.auth;
|
const auth = req.body.auth || row.auth;
|
||||||
const secret = req.body.secret || row.secret;
|
const secret = req.body.secret || row.secret;
|
||||||
const block_start = req.body.block_start || row.block_start;
|
const block_start = req.body.block_start || row.block_start;
|
||||||
const block_length = req.body.block_length || row.block_length;
|
const block_length = req.body.block_length || row.block_length;
|
||||||
const contact = req.body.contact || row.contact;
|
const contact = req.body.contact || row.contact;
|
||||||
console.log(`Updating ${req.params.id} to ${server}:${port} with ${auth}:${secret} for ${block_start} - ${block_start + block_length}. Contact: ${contact}`);
|
console.log(`Updating ${req.params.id} to ${server}:${port} with ${auth}:${secret} for ${block_start} - ${block_start + block_length}. Contact: ${contact}`);
|
||||||
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 = ?, apiKey = ? 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.body.apiKey, req.params.id]).then(async () => {
|
||||||
res.json({ message: 'Updated' });
|
res.json({ message: 'Updated' });
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.error('Error updating route:', err);
|
console.error('Error updating route:', err);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue