From 31e7aa300af3959ce0760dee921c5e015056414a Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 11 Feb 2025 17:53:43 -0700 Subject: [PATCH] Delete dir entries when removing route, duh --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 => {