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

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

View File

@@ -353,8 +353,19 @@ export class ChannelStartupService {
}
public async setProxy(data: ProxyDto) {
await this.prismaRepository.proxy.create({
data: {
await this.prismaRepository.proxy.upsert({
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,
host: data.host,
port: data.port,