mirror of
https://github.com/hexastack/hexabot
synced 2025-02-23 04:48:51 +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> {
|
): Promise<void> {
|
||||||
const subscriberUpdates: SubscriberUpdateDto = updates?.['$set'];
|
const subscriberUpdates: SubscriberUpdateDto = updates?.['$set'];
|
||||||
|
|
||||||
|
if ('assignedTo' in subscriberUpdates) {
|
||||||
|
// In case of a handover or handback, emit events
|
||||||
const oldSubscriber = await this.findOne(criteria);
|
const oldSubscriber = await this.findOne(criteria);
|
||||||
|
|
||||||
if (!oldSubscriber) {
|
if (!oldSubscriber) {
|
||||||
@ -103,6 +105,7 @@ export class SubscriberRepository extends BaseRepository<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a query to find a subscriber by their foreign ID.
|
* Constructs a query to find a subscriber by their foreign ID.
|
||||||
|
Loading…
Reference in New Issue
Block a user