diff --git a/backend/src/api/routes/image.js b/backend/src/api/routes/image.js index 0d1c1ac..68ebd9d 100644 --- a/backend/src/api/routes/image.js +++ b/backend/src/api/routes/image.js @@ -3,9 +3,8 @@ import { uploadAvatar } from "../../loaders/multer"; const router = Router(); -router.post("/upload", uploadAvatar, (req, res) => { - const { fieldname, originalname, encoding, mimetype, destination, filename, path, size } = req.file - const { name } = req.body; +router.post("/upload-avatar", uploadAvatar, (req, res) => { + const { fieldname, originalname, encoding, mimetype, destination, filename, path, size } = req.file; res.json({path: `/public/${filename}`}); });