make it bettersl

This commit is contained in:
pawan-dot 2022-06-10 22:22:41 +05:30
parent ff8e0f12b7
commit dea52385f5
10 changed files with 6 additions and 6 deletions

View File

@ -3,15 +3,16 @@ import cloudinary from "cloudinary";
export const createDirectory = async (req, res) => {
try {
let image;
// console.log(req.files)
if (req.files !== null) {
let images;
// console.log(req.body)
// console.log(req.files.image)
if (req.files) {
const files = req.files.image;
const myCloud = await cloudinary.uploader.upload(files.tempFilePath, {
folder: "cmp/image",
},
function (error, result) { (result, error) });
image = {
images = {
public_id: myCloud.public_id,
url: myCloud.secure_url,
}
@ -32,7 +33,6 @@ export const createDirectory = async (req, res) => {
FacebookUrl,
InstagramUrl,
} = req.body;
// console.log(req.body)
const data = await directoryModel.create({
name,
@ -49,7 +49,7 @@ export const createDirectory = async (req, res) => {
LinkedinUrl,
FacebookUrl,
InstagramUrl,
image: image
image: images
});
res.status(201).json({

BIN
tmp/tmp-1-1654878203409 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654878668365 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654879240003 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654879315699 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654879381712 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654879478391 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-1-1654879780998 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-2-1654878217852 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
tmp/tmp-2-1654878672959 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB