fix(auth): updating offline subscription end date
This commit is contained in:
parent
805e63379c
commit
2504887e8d
1 changed files with 7 additions and 2 deletions
|
@ -37,7 +37,11 @@ export class SubscriptionRenewedEventHandler implements DomainEventHandlerInterf
|
|||
return
|
||||
}
|
||||
|
||||
await this.updateOfflineSubscriptionEndsAt(offlineUserSubscription, event.payload.timestamp)
|
||||
await this.updateOfflineSubscriptionEndsAt(
|
||||
offlineUserSubscription,
|
||||
event.payload.subscriptionExpiresAt,
|
||||
event.payload.timestamp,
|
||||
)
|
||||
|
||||
await this.roleService.setOfflineUserRole(offlineUserSubscription)
|
||||
|
||||
|
@ -92,9 +96,10 @@ export class SubscriptionRenewedEventHandler implements DomainEventHandlerInterf
|
|||
|
||||
private async updateOfflineSubscriptionEndsAt(
|
||||
offlineUserSubscription: OfflineUserSubscription,
|
||||
subscriptionExpiresAt: number,
|
||||
timestamp: number,
|
||||
): Promise<void> {
|
||||
offlineUserSubscription.endsAt = timestamp
|
||||
offlineUserSubscription.endsAt = subscriptionExpiresAt
|
||||
offlineUserSubscription.updatedAt = timestamp
|
||||
|
||||
await this.offlineUserSubscriptionRepository.save(offlineUserSubscription)
|
||||
|
|
Loading…
Reference in a new issue