|
@@ -95,6 +95,7 @@ const imageMessage = async (req, res, next) => {
|
|
|
const DIR_IMAGES = process.env.DIR_IMAGES;
|
|
|
const pathToFile = req.file.path;
|
|
|
const newNameImg = req.file.originalname;
|
|
|
+ const fullType = req.file.mimetype;
|
|
|
await Jimp.read(pathToFile);
|
|
|
await createFolderIsExist(path.join(DIR_IMAGES, userId));
|
|
|
await fs.rename(pathToFile, path.join(DIR_IMAGES, userId, newNameImg));
|
|
@@ -109,6 +110,7 @@ const imageMessage = async (req, res, next) => {
|
|
|
color,
|
|
|
number,
|
|
|
type: 'image',
|
|
|
+ fullType,
|
|
|
companionId: id,
|
|
|
owner: userId,
|
|
|
});
|
|
@@ -120,6 +122,7 @@ const imageMessage = async (req, res, next) => {
|
|
|
color,
|
|
|
number,
|
|
|
type: 'image',
|
|
|
+ fullType,
|
|
|
companionId: userId,
|
|
|
owner: id,
|
|
|
});
|