This commit is contained in:
Christopher Cookman 2024-11-15 12:26:16 -07:00
parent e5c2c99165
commit 1412768d4f

View file

@ -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) {