Skip to content

Commit 717e359

Browse files
🐛 Fix typo in requesting filename
1 parent 2242dbe commit 717e359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routes/products.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ router.post('/', upload.single('image'), async (req, res) => {
6969
if (!file)
7070
return res.status(400).send('No image in the request')
7171

72-
const fileName = file.filename;
72+
const fileName = req.file.filename;
7373
const basePath = `${req.protocol}://${req.get('host')}/public/uploads/`;
7474

7575
let product = new Product({

0 commit comments

Comments
 (0)