diff --git a/index.js b/index.js index 1e9634a..88f3078 100644 --- a/index.js +++ b/index.js @@ -345,7 +345,8 @@ app.delete('/api/v1/admin/route/:id', (req, res) => { // Delete a route res.status(401).json({ error: 'Unauthorized' }); return; } - pool.getConnection().then(conn => { + pool.getConnection().then(async conn => { + await conn.query('DELETE FROM directory WHERE route = ?', [req.params.id]) conn.query('DELETE FROM routes WHERE id = ?', [req.params.id]).then(() => { res.json({ message: 'Deleted' }); }).catch(err => {