Skip to content

Commit

Permalink
bug fix; inverted conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
erikshafer committed May 9, 2024
1 parent 7e206f0 commit 56fa5ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Catalog/Catalog/Products/ProductState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static ProductState Handle(ProductState state, V1.ProductArchived @event

private static ProductState Handle(ProductState state, V1.ProductDraftCancelled @event)
{
if (state.Status == ProductStatus.Drafted)
if (state.Status != ProductStatus.Drafted)
throw new DomainException($"Product can only be set to {nameof(ProductStatus.Cancelled)} from {nameof(ProductStatus.Drafted)}");

return state with { Status = ProductStatus.Cancelled };
Expand Down

0 comments on commit 56fa5ab

Please sign in to comment.