From f340f7716fb949e729fed5a2a513790843543988 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 22 Jan 2025 11:14:05 -0300 Subject: [PATCH] Remove unused dependencies from ChannelController to streamline integration logic --- src/api/integrations/channel/channel.controller.ts | 2 -- .../channel/evolution/evolution.channel.service.ts | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/api/integrations/channel/channel.controller.ts b/src/api/integrations/channel/channel.controller.ts index 3304d987..051be726 100644 --- a/src/api/integrations/channel/channel.controller.ts +++ b/src/api/integrations/channel/channel.controller.ts @@ -75,8 +75,6 @@ export class ChannelController { data.prismaRepository, data.cache, data.chatwootCache, - data.baileysCache, - data.providerFiles, ); } diff --git a/src/api/integrations/channel/evolution/evolution.channel.service.ts b/src/api/integrations/channel/evolution/evolution.channel.service.ts index 3c80d8a6..dba02751 100644 --- a/src/api/integrations/channel/evolution/evolution.channel.service.ts +++ b/src/api/integrations/channel/evolution/evolution.channel.service.ts @@ -20,7 +20,6 @@ import axios from 'axios'; import { isBase64, isURL } from 'class-validator'; import EventEmitter2 from 'eventemitter2'; import FormData from 'form-data'; -import mime from 'mime'; import mimeTypes from 'mime-types'; import { join } from 'path'; import { v4 } from 'uuid'; @@ -672,9 +671,9 @@ export class EvolutionStartupService extends ChannelStartupService { }; if (isURL(audio)) { - mimetype = mime.getType(audio); + mimetype = mimeTypes.lookup(audio).toString(); } else { - mimetype = mime.getType(prepareMedia.fileName); + mimetype = mimeTypes.lookup(prepareMedia.fileName).toString(); } prepareMedia.mimetype = mimetype;