Skip to content

Commit 460c893

Browse files
authored
Added suggestions by @sourcery-ai
1 parent bbbe667 commit 460c893

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/api/extensions/prismaExtensionPgpathToMysql.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { Logger } from '@config/logger.config';
44
const logger = new Logger('PGPATH2MYSQL');
55

66
function convertPgPathToMysql (path) {
7-
if (!Array.isArray(path)) return path
7+
if (!Array.isArray(path)) {
8+
return path
9+
}
810
let result = '$'
911
for (const item of path) {
1012
if (/^\d+$/.test(item)) {

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ export class BaileysStartupService extends ChannelStartupService {
15091509
remoteJid: key.remoteJid,
15101510
fromMe: key.fromMe,
15111511
participant: key?.remoteJid,
1512-
status: status[update.status] || findMessage.status,
1512+
status: status[update.status] ?? findMessage.status,
15131513
pollUpdates,
15141514
instanceId: this.instanceId,
15151515
};

src/api/server.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ if (configService.get<ProviderSession>('PROVIDER').ENABLED) {
6060

6161
const provider = configService.get<Database>('DATABASE').PROVIDER;
6262
let extendablePrismaRepository: PrismaRepository = new PrismaRepository(configService)
63-
if (provider === "mysql") {
63+
if (typeof provider === 'string' && provider?.toLowerCase() === 'mysql') {
6464
extendablePrismaRepository = extendsWithProxy(extendablePrismaRepository, pgPathToMysql);
6565
}
6666
export const prismaRepository = extendablePrismaRepository;

0 commit comments

Comments
 (0)