diff --git a/index.js b/index.js index bd63da1..a32ef0d 100644 --- a/index.js +++ b/index.js @@ -125,6 +125,7 @@ app.patch('/:shortUrl', (req, res) => { if (!req.body.url) { return res.status(400).json({ error: 'Please provide a URL' }); } + const url = req.body.url; const shortUrl = req.params.shortUrl; db.get('SELECT * FROM urls WHERE shortUrl = ?', [shortUrl], (err, row) => { if (err) {