mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-22 03:56:54 -06:00
Added suggestions by @sourcery-ai
This commit is contained in:
parent
bbbe667cfa
commit
460c893c3a
@ -4,7 +4,9 @@ import { Logger } from '@config/logger.config';
|
|||||||
const logger = new Logger('PGPATH2MYSQL');
|
const logger = new Logger('PGPATH2MYSQL');
|
||||||
|
|
||||||
function convertPgPathToMysql (path) {
|
function convertPgPathToMysql (path) {
|
||||||
if (!Array.isArray(path)) return path
|
if (!Array.isArray(path)) {
|
||||||
|
return path
|
||||||
|
}
|
||||||
let result = '$'
|
let result = '$'
|
||||||
for (const item of path) {
|
for (const item of path) {
|
||||||
if (/^\d+$/.test(item)) {
|
if (/^\d+$/.test(item)) {
|
||||||
|
@ -1509,7 +1509,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
|||||||
remoteJid: key.remoteJid,
|
remoteJid: key.remoteJid,
|
||||||
fromMe: key.fromMe,
|
fromMe: key.fromMe,
|
||||||
participant: key?.remoteJid,
|
participant: key?.remoteJid,
|
||||||
status: status[update.status] || findMessage.status,
|
status: status[update.status] ?? findMessage.status,
|
||||||
pollUpdates,
|
pollUpdates,
|
||||||
instanceId: this.instanceId,
|
instanceId: this.instanceId,
|
||||||
};
|
};
|
||||||
|
@ -60,7 +60,7 @@ if (configService.get<ProviderSession>('PROVIDER').ENABLED) {
|
|||||||
|
|
||||||
const provider = configService.get<Database>('DATABASE').PROVIDER;
|
const provider = configService.get<Database>('DATABASE').PROVIDER;
|
||||||
let extendablePrismaRepository: PrismaRepository = new PrismaRepository(configService)
|
let extendablePrismaRepository: PrismaRepository = new PrismaRepository(configService)
|
||||||
if (provider === "mysql") {
|
if (typeof provider === 'string' && provider?.toLowerCase() === 'mysql') {
|
||||||
extendablePrismaRepository = extendsWithProxy(extendablePrismaRepository, pgPathToMysql);
|
extendablePrismaRepository = extendsWithProxy(extendablePrismaRepository, pgPathToMysql);
|
||||||
}
|
}
|
||||||
export const prismaRepository = extendablePrismaRepository;
|
export const prismaRepository = extendablePrismaRepository;
|
||||||
|
Loading…
Reference in New Issue
Block a user