mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: address review
This commit is contained in:
@@ -172,6 +172,15 @@ export abstract class BaseRepository<
|
||||
);
|
||||
});
|
||||
|
||||
hooks?.updateMany.post.execute(async function (updated: any) {
|
||||
const query = this as Query<D, D, unknown, T, 'updateMany'>;
|
||||
await repository.postUpdateMany(query, updated);
|
||||
repository.emitter.emit(
|
||||
repository.getEventName(EHook.postUpdateMany),
|
||||
updated,
|
||||
);
|
||||
});
|
||||
|
||||
hooks?.findOneAndUpdate.post.execute(async function (
|
||||
updated: HydratedDocument<T>,
|
||||
) {
|
||||
@@ -398,6 +407,13 @@ export abstract class BaseRepository<
|
||||
// Nothing ...
|
||||
}
|
||||
|
||||
async postUpdateMany(
|
||||
_query: Query<D, D, unknown, T, 'updateMany'>,
|
||||
_updated: any,
|
||||
) {
|
||||
// Nothing ...
|
||||
}
|
||||
|
||||
async postUpdate(
|
||||
_query: Query<D, D, unknown, T, 'findOneAndUpdate'>,
|
||||
_updated: T,
|
||||
|
||||
Reference in New Issue
Block a user