From 6dbc1d19074350405c9f49de7fee33d01639cb88 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Sat, 5 Oct 2024 15:27:03 +0100 Subject: [PATCH] fix(api): remove unnecessary ternary check --- api/src/utils/generics/base-repository.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/utils/generics/base-repository.ts b/api/src/utils/generics/base-repository.ts index a085b24..21ca337 100644 --- a/api/src/utils/generics/base-repository.ts +++ b/api/src/utils/generics/base-repository.ts @@ -86,7 +86,7 @@ export abstract class BaseRepository< }); hooks?.save.post.execute(async function (created: HydratedDocument) { - repository.emitter?.emit( + repository.emitter.emit( repository.getEventName(EHook.postCreate), created, ); @@ -111,7 +111,7 @@ export abstract class BaseRepository< }); hooks?.deleteMany.post.execute(async function (result: DeleteResult) { - repository.emitter?.emit( + repository.emitter.emit( repository.getEventName(EHook.postDelete), result, ); @@ -124,7 +124,7 @@ export abstract class BaseRepository< const criteria = query.getFilter(); const updates = query.getUpdate(); - repository.emitter?.emit( + repository.emitter.emit( repository.getEventName(EHook.preUpdate), criteria, updates?.['$set'], @@ -136,7 +136,7 @@ export abstract class BaseRepository< updated: HydratedDocument, ) { if (updated) { - repository.emitter?.emit( + repository.emitter.emit( repository.getEventName(EHook.postUpdate), updated, );