fix: fixed proxy config in manager

This commit is contained in:
Davidson Gomes 2024-08-23 14:05:48 -03:00
parent 6a62ae85fc
commit 1f0a5a2e09
3 changed files with 15 additions and 3 deletions

View File

@ -14,6 +14,7 @@
* Refactor integrations structure for modular system * Refactor integrations structure for modular system
* Fixed dify agent integration * Fixed dify agent integration
* Update Baileys Version * Update Baileys Version
* Fixed proxy config in manager
# 2.0.10 (2024-08-16 16:23) # 2.0.10 (2024-08-16 16:23)

View File

@ -89,7 +89,7 @@ export class EventController {
instanceId: this.monitor.waInstances[instanceName].instanceId, instanceId: this.monitor.waInstances[instanceName].instanceId,
}, },
update: { update: {
...data, ...data[this.name],
}, },
create: { create: {
enabled: data[this.name]?.enabled, enabled: data[this.name]?.enabled,

View File

@ -353,8 +353,19 @@ export class ChannelStartupService {
} }
public async setProxy(data: ProxyDto) { public async setProxy(data: ProxyDto) {
await this.prismaRepository.proxy.create({ await this.prismaRepository.proxy.upsert({
data: { where: {
instanceId: this.instanceId,
},
update: {
enabled: data?.enabled,
host: data.host,
port: data.port,
protocol: data.protocol,
username: data.username,
password: data.password,
},
create: {
enabled: data?.enabled, enabled: data?.enabled,
host: data.host, host: data.host,
port: data.port, port: data.port,