diff --git a/server.js b/server.js index c34c3de..350616c 100644 --- a/server.js +++ b/server.js @@ -51,34 +51,7 @@ app.use(session({ app.use('/', authRouter); app.use('/', authMiddleware, tasksRouter); -// Add routes for handling tags -app.post('/save-tags', authMiddleware, (req, res) => { - const { tags } = req.body; - const placeholders = tags.map(() => '(?)').join(','); - const sql = `INSERT OR IGNORE INTO tags (tag) VALUES ${placeholders}`; - db.run(sql, tags, function(err) { - if (err) { - logger.error('Error saving tags:', err); - res.status(500).send('Error saving tags.'); - } else { - res.send({ message: 'Tags saved successfully!' }); - logger.info(`New tags saved: ${tags}`); - } - }); -}); - -app.get('/get-tags', authMiddleware, (req, res) => { - db.all('SELECT tag FROM tags', [], (err, rows) => { - if (err) { - logger.error('Error retrieving tags:', err); - res.status(500).json({ error: 'Error retrieving tags' }); - } else { - const tags = rows.map(row => row.tag); - res.json(tags); - } - }); -}); app.listen(port, () => { logger.info(`Server running at http://localhost:${port}`);