Skip to content

Commit 092ece1

Browse files
committed
chore: correct minor fix (api prefix)
1 parent 5359ac3 commit 092ece1

File tree

160 files changed

+14
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+14
-4
lines changed

middlewares/file-upload/uploadImage.middleware.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ const getImageExtension = require('../../utils/getImageExtension');
66
// Configuring and validating the upload
77
const storage = multer.diskStorage({
88
destination: (req, file, callbackFunction) => {
9-
callbackFunction(null, 'public/uploads');
9+
const { isUserImg } = req.body;
10+
11+
if (file?.fieldname === 'profileImage') {
12+
callbackFunction(null, 'public/uploads/users');
13+
} else {
14+
callbackFunction(null, 'public/uploads');
15+
}
1016
},
1117

1218
// By default, multer removes file extensions so let's add them back
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-35.2 KB
Binary file not shown.
-259 KB
Binary file not shown.
-259 KB
Binary file not shown.

0 commit comments

Comments
 (0)