make it bettersl
This commit is contained in:
parent
32265adb3c
commit
ff8e0f12b7
@ -3,13 +3,19 @@ import cloudinary from "cloudinary";
|
||||
export const createDirectory = async (req, res) => {
|
||||
|
||||
try {
|
||||
const files = req.files.image;
|
||||
// console.log(req.body)
|
||||
// console.log(files)
|
||||
const myCloud = await cloudinary.uploader.upload(files.tempFilePath, {
|
||||
folder: "cmp/image",
|
||||
},
|
||||
function (error, result) { (result, error) });
|
||||
let image;
|
||||
// console.log(req.files)
|
||||
if (req.files !== null) {
|
||||
const files = req.files.image;
|
||||
const myCloud = await cloudinary.uploader.upload(files.tempFilePath, {
|
||||
folder: "cmp/image",
|
||||
},
|
||||
function (error, result) { (result, error) });
|
||||
image = {
|
||||
public_id: myCloud.public_id,
|
||||
url: myCloud.secure_url,
|
||||
}
|
||||
}
|
||||
const {
|
||||
name,
|
||||
phone,
|
||||
@ -43,10 +49,7 @@ export const createDirectory = async (req, res) => {
|
||||
LinkedinUrl,
|
||||
FacebookUrl,
|
||||
InstagramUrl,
|
||||
image: {
|
||||
public_id: myCloud.public_id,
|
||||
url: myCloud.secure_url,
|
||||
},
|
||||
image: image
|
||||
|
||||
});
|
||||
res.status(201).json({
|
||||
|
BIN
tmp/tmp-1-1654869231487
Normal file
BIN
tmp/tmp-1-1654869231487
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
tmp/tmp-1-1654869330605
Normal file
BIN
tmp/tmp-1-1654869330605
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
tmp/tmp-1-1654875653394
Normal file
BIN
tmp/tmp-1-1654875653394
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
tmp/tmp-1-1654875744407
Normal file
BIN
tmp/tmp-1-1654875744407
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 MiB |
BIN
tmp/tmp-1-1654876070898
Normal file
BIN
tmp/tmp-1-1654876070898
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
BIN
tmp/tmp-1-1654877661934
Normal file
BIN
tmp/tmp-1-1654877661934
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Loading…
Reference in New Issue
Block a user