Skip to content

Commit

Permalink
#5300 Removed unnecessary event publications
Browse files Browse the repository at this point in the history
  • Loading branch information
skoshelev committed Jan 26, 2021
1 parent 6fbcbeb commit 1d6d8cb
Showing 1 changed file with 1 addition and 10 deletions.
Expand Up @@ -86,10 +86,7 @@ public virtual async Task InsertNewsLetterSubscriptionAsync(NewsLetterSubscripti

//Persist
await _subscriptionRepository.InsertAsync(newsLetterSubscription);

//Publish event
await _eventPublisher.EntityInsertedAsync(newsLetterSubscription);


//Publish the subscription event
if (newsLetterSubscription.Active)
await PublishSubscriptionEventAsync(newsLetterSubscription, true, publishSubscriptionEvents);
Expand All @@ -116,9 +113,6 @@ public virtual async Task UpdateNewsLetterSubscriptionAsync(NewsLetterSubscripti
//Persist
await _subscriptionRepository.UpdateAsync(newsLetterSubscription);

//Publish event
await _eventPublisher.EntityUpdatedAsync(newsLetterSubscription);

//Publish the subscription event
if ((originalSubscription.Active == false && newsLetterSubscription.Active) ||
(newsLetterSubscription.Active && originalSubscription.Email != newsLetterSubscription.Email))
Expand Down Expand Up @@ -151,9 +145,6 @@ public virtual async Task DeleteNewsLetterSubscriptionAsync(NewsLetterSubscripti

await _subscriptionRepository.DeleteAsync(newsLetterSubscription);

//event notification
await _eventPublisher.EntityDeletedAsync(newsLetterSubscription);

//Publish the unsubscribe event
await PublishSubscriptionEventAsync(newsLetterSubscription, false, publishSubscriptionEvents);
}
Expand Down

0 comments on commit 1d6d8cb

Please sign in to comment.