mirror of
https://github.com/hexastack/hexabot
synced 2024-11-26 21:59:53 +00:00
fix(api): remove unnecessary ternary check
This commit is contained in:
parent
daffdead62
commit
6dbc1d1907
@ -86,7 +86,7 @@ export abstract class BaseRepository<
|
|||||||
});
|
});
|
||||||
|
|
||||||
hooks?.save.post.execute(async function (created: HydratedDocument<T>) {
|
hooks?.save.post.execute(async function (created: HydratedDocument<T>) {
|
||||||
repository.emitter?.emit(
|
repository.emitter.emit(
|
||||||
repository.getEventName(EHook.postCreate),
|
repository.getEventName(EHook.postCreate),
|
||||||
created,
|
created,
|
||||||
);
|
);
|
||||||
@ -111,7 +111,7 @@ export abstract class BaseRepository<
|
|||||||
});
|
});
|
||||||
|
|
||||||
hooks?.deleteMany.post.execute(async function (result: DeleteResult) {
|
hooks?.deleteMany.post.execute(async function (result: DeleteResult) {
|
||||||
repository.emitter?.emit(
|
repository.emitter.emit(
|
||||||
repository.getEventName(EHook.postDelete),
|
repository.getEventName(EHook.postDelete),
|
||||||
result,
|
result,
|
||||||
);
|
);
|
||||||
@ -124,7 +124,7 @@ export abstract class BaseRepository<
|
|||||||
const criteria = query.getFilter();
|
const criteria = query.getFilter();
|
||||||
const updates = query.getUpdate();
|
const updates = query.getUpdate();
|
||||||
|
|
||||||
repository.emitter?.emit(
|
repository.emitter.emit(
|
||||||
repository.getEventName(EHook.preUpdate),
|
repository.getEventName(EHook.preUpdate),
|
||||||
criteria,
|
criteria,
|
||||||
updates?.['$set'],
|
updates?.['$set'],
|
||||||
@ -136,7 +136,7 @@ export abstract class BaseRepository<
|
|||||||
updated: HydratedDocument<T>,
|
updated: HydratedDocument<T>,
|
||||||
) {
|
) {
|
||||||
if (updated) {
|
if (updated) {
|
||||||
repository.emitter?.emit(
|
repository.emitter.emit(
|
||||||
repository.getEventName(EHook.postUpdate),
|
repository.getEventName(EHook.postUpdate),
|
||||||
updated,
|
updated,
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user