Skip to content

Commit 48af69c

Browse files
Minor updates in comments, so it is clearer.
1 parent c706c1d commit 48af69c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public async Task<IActionResult> UpdateProduct([FromBody]CatalogItem productToUp
180180
catalogItem = productToUpdate;
181181
_catalogContext.CatalogItems.Update(catalogItem);
182182

183-
if (raiseProductPriceChangedEvent) // Save and publish integration event if price has changed
183+
if (raiseProductPriceChangedEvent) // Save product's data and publish integration event through the Event Bus if price has changed
184184
{
185185
//Create Integration Event to be published through the Event Bus
186186
var priceChangedEvent = new ProductPriceChangedIntegrationEvent(catalogItem.Id, productToUpdate.Price, oldPrice);
@@ -191,7 +191,7 @@ public async Task<IActionResult> UpdateProduct([FromBody]CatalogItem productToUp
191191
// Publish through the Event Bus and mark the saved event as published
192192
await _catalogIntegrationEventService.PublishThroughEventBusAsync(priceChangedEvent);
193193
}
194-
else // Save updated product
194+
else // Just save the updated product because the Product's Price hasn't changed.
195195
{
196196
await _catalogContext.SaveChangesAsync();
197197
}

0 commit comments

Comments
 (0)