mirror of
https://github.com/hexastack/hexabot
synced 2025-02-22 20:38:32 +00:00
fix: handover/handback lifecycle hook
This commit is contained in:
parent
1288eb87cf
commit
21301b9702
@ -80,6 +80,8 @@ export class SubscriberRepository extends BaseRepository<
|
||||
): Promise<void> {
|
||||
const subscriberUpdates: SubscriberUpdateDto = updates?.['$set'];
|
||||
|
||||
if ('assignedTo' in subscriberUpdates) {
|
||||
// In case of a handover or handback, emit events
|
||||
const oldSubscriber = await this.findOne(criteria);
|
||||
|
||||
if (!oldSubscriber) {
|
||||
@ -103,6 +105,7 @@ export class SubscriberRepository extends BaseRepository<
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a query to find a subscriber by their foreign ID.
|
||||
|
Loading…
Reference in New Issue
Block a user