make it bettersl

This commit is contained in:
pawan-dot 2022-06-10 21:47:51 +05:30
parent 32265adb3c
commit ff8e0f12b7
7 changed files with 14 additions and 11 deletions

View File

@ -3,13 +3,19 @@ import cloudinary from "cloudinary";
export const createDirectory = async (req, res) => {
try {
let image;
// console.log(req.files)
if (req.files !== null) {
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) });
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654877661934 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB