mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 12:22:21 -06:00
refactor: integration folders and fix manager bugs
This commit is contained in:
@@ -19,7 +19,7 @@ export class ChatwootController {
|
||||
public async createChatwoot(instance: InstanceDto, data: ChatwootDto) {
|
||||
if (!this.configService.get<Chatwoot>('CHATWOOT').ENABLED) throw new BadRequestException('Chatwoot is disabled');
|
||||
|
||||
if (data.enabled) {
|
||||
if (data?.enabled) {
|
||||
if (!isURL(data.url, { require_tld: false })) {
|
||||
throw new BadRequestException('url is not valid');
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ export class DifyController extends ChatbotController implements ChatbotControll
|
||||
try {
|
||||
const bot = await this.botRepository.create({
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
botType: data.botType,
|
||||
apiUrl: data.apiUrl,
|
||||
@@ -331,7 +331,7 @@ export class DifyController extends ChatbotController implements ChatbotControll
|
||||
id: botId,
|
||||
},
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
botType: data.botType,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
|
||||
@@ -145,7 +145,7 @@ export class FlowiseController extends ChatbotController implements ChatbotContr
|
||||
try {
|
||||
const bot = await this.botRepository.create({
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
@@ -318,7 +318,7 @@ export class FlowiseController extends ChatbotController implements ChatbotContr
|
||||
id: botId,
|
||||
},
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
expire: data.expire,
|
||||
|
||||
@@ -145,7 +145,7 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
||||
try {
|
||||
const bot = await this.botRepository.create({
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
@@ -318,7 +318,7 @@ export class GenericController extends ChatbotController implements ChatbotContr
|
||||
id: botId,
|
||||
},
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
apiUrl: data.apiUrl,
|
||||
apiKey: data.apiKey,
|
||||
expire: data.expire,
|
||||
|
||||
@@ -314,7 +314,7 @@ export class OpenaiController extends ChatbotController implements ChatbotContro
|
||||
try {
|
||||
const bot = await this.botRepository.create({
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
openaiCredsId: data.openaiCredsId,
|
||||
botType: data.botType,
|
||||
@@ -528,7 +528,7 @@ export class OpenaiController extends ChatbotController implements ChatbotContro
|
||||
id: botId,
|
||||
},
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
openaiCredsId: data.openaiCredsId,
|
||||
botType: data.botType,
|
||||
assistantId: data.assistantId,
|
||||
|
||||
@@ -151,7 +151,7 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
try {
|
||||
const bot = await this.botRepository.create({
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
description: data.description,
|
||||
url: data.url,
|
||||
typebot: data.typebot,
|
||||
@@ -334,7 +334,7 @@ export class TypebotController extends ChatbotController implements ChatbotContr
|
||||
id: botId,
|
||||
},
|
||||
data: {
|
||||
enabled: data.enabled,
|
||||
enabled: data?.enabled,
|
||||
url: data.url,
|
||||
typebot: data.typebot,
|
||||
expire: data.expire,
|
||||
|
||||
@@ -382,7 +382,7 @@ export class TypebotService {
|
||||
}
|
||||
|
||||
const data = await this.createNewSession(instance, {
|
||||
enabled: findTypebot.enabled,
|
||||
enabled: findTypebot?.enabled,
|
||||
url: url,
|
||||
typebot: typebot,
|
||||
expire: expire,
|
||||
|
||||
Reference in New Issue
Block a user