BWuh
This commit is contained in:
parent
e5c2c99165
commit
1412768d4f
1
index.js
1
index.js
|
@ -125,6 +125,7 @@ app.patch('/:shortUrl', (req, res) => {
|
||||||
if (!req.body.url) {
|
if (!req.body.url) {
|
||||||
return res.status(400).json({ error: 'Please provide a URL' });
|
return res.status(400).json({ error: 'Please provide a URL' });
|
||||||
}
|
}
|
||||||
|
const url = req.body.url;
|
||||||
const shortUrl = req.params.shortUrl;
|
const shortUrl = req.params.shortUrl;
|
||||||
db.get('SELECT * FROM urls WHERE shortUrl = ?', [shortUrl], (err, row) => {
|
db.get('SELECT * FROM urls WHERE shortUrl = ?', [shortUrl], (err, row) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|
Loading…
Reference in a new issue