Skip to content

Commit 45e461e

Browse files
committed
lint
1 parent be57609 commit 45e461e

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ export class BaileysStartupService extends ChannelStartupService {
273273
if (provider?.ENABLED) {
274274
const authState = await this.authStateProvider.authStateProvider(this.instance.id);
275275

276-
await authState.removeCreds()
276+
await authState.removeCreds();
277277
}
278278

279279
if (cache?.REDIS.ENABLED && cache?.REDIS.SAVE_INSTANCES) {
280280
const authState = await useMultiFileAuthStateRedisDb(this.instance.id, this.cache);
281281

282-
await authState.removeCreds()
282+
await authState.removeCreds();
283283
}
284284

285285
if (db.SAVE_DATA.INSTANCE) {
286286
const authState = await useMultiFileAuthStatePrisma(this.instance.id, this.cache);
287287

288-
await authState.removeCreds()
288+
await authState.removeCreds();
289289
}
290290

291291
const sessionExists = await this.prismaRepository.session.findFirst({ where: { sessionId: this.instanceId } });

src/utils/use-multi-file-auth-state-prisma.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { prismaRepository } from '@api/server.module';
22
import { CacheService } from '@api/services/cache.service';
33
import { CacheConf, configService } from '@config/env.config';
4+
import { Logger } from '@config/logger.config';
45
import { INSTANCE_DIR } from '@config/path.config';
56
import { AuthenticationState, BufferJSON, initAuthCreds, WAProto as proto } from 'baileys';
67
import fs from 'fs/promises';
78
import path from 'path';
8-
import {Logger} from "@config/logger.config";
99

1010
const fixFileName = (file: string): string | undefined => {
1111
if (!file) {
@@ -147,7 +147,6 @@ export default async function useMultiFileAuthStatePrisma(
147147
}
148148

149149
async function removeCreds(): Promise<any> {
150-
151150
const cacheConfig = configService.get<CacheConf>('CACHE');
152151

153152
// Redis
@@ -156,7 +155,7 @@ export default async function useMultiFileAuthStatePrisma(
156155
await cache.delete(sessionId);
157156
logger.info({ action: 'redis.delete', sessionId });
158157

159-
return
158+
return;
160159
}
161160
} catch (err) {
162161
logger.warn({ action: 'redis.delete', sessionId, err });
@@ -209,6 +208,6 @@ export default async function useMultiFileAuthStatePrisma(
209208
return writeData(creds, 'creds');
210209
},
211210

212-
removeCreds
211+
removeCreds,
213212
};
214213
}

src/utils/use-multi-file-auth-state-provider-files.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import { isNotEmpty } from 'class-validator';
4141

4242
export type AuthState = {
4343
state: AuthenticationState;
44-
saveCreds: () => Promise<void>
44+
saveCreds: () => Promise<void>;
4545
removeCreds: () => Promise<void>;
4646
};
4747

@@ -91,7 +91,6 @@ export class AuthStateProvider {
9191
};
9292

9393
const removeCreds = async () => {
94-
9594
const [response, error] = await this.providerFiles.removeSession(instance);
9695
if (error) {
9796
// this.logger.error(['removeData', error?.message, error?.stack]);
@@ -144,7 +143,7 @@ export class AuthStateProvider {
144143
return await writeData(creds, 'creds');
145144
},
146145

147-
removeCreds
146+
removeCreds,
148147
};
149148
}
150149
}

src/utils/use-multi-file-auth-state-redis-db.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export async function useMultiFileAuthStateRedisDb(
3939

4040
async function removeCreds(): Promise<any> {
4141
try {
42-
4342
logger.warn({ action: 'redis.delete', instanceName });
4443

4544
return await cache.delete(instanceName);
@@ -89,6 +88,6 @@ export async function useMultiFileAuthStateRedisDb(
8988
return await writeData(creds, 'creds');
9089
},
9190

92-
removeCreds
91+
removeCreds,
9392
};
9493
}

0 commit comments

Comments
 (0)