From da141311ff3940dd1285fdaddb45d9ea91bc735d Mon Sep 17 00:00:00 2001 From: Khwezi Mngoma Date: Sun, 17 May 2026 16:00:35 +0200 Subject: [PATCH] Simplified notification updating --- LiteCharms.Features.Tests/NotificationsFeatureTests.cs | 2 +- .../Shop/Notifications/NotificationService.cs | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/LiteCharms.Features.Tests/NotificationsFeatureTests.cs b/LiteCharms.Features.Tests/NotificationsFeatureTests.cs index 7ee7e9a..05b9f9f 100644 --- a/LiteCharms.Features.Tests/NotificationsFeatureTests.cs +++ b/LiteCharms.Features.Tests/NotificationsFeatureTests.cs @@ -40,7 +40,7 @@ public class NotificationsFeatureTests(CommonFixture fixture, ITestOutputHelper { DateRange range = new() { - From = DateOnly.FromDateTime(new DateTime(2026, 05, 01, 0, 0, 0, DateTimeKind.Utc)), + From = DateOnly.FromDateTime(new DateTime(2026, 04, 01, 0, 0, 0, DateTimeKind.Utc)), To = DateOnly.FromDateTime(DateTime.UtcNow), MaxRecords = 10 }; diff --git a/LiteCharms.Features/Shop/Notifications/NotificationService.cs b/LiteCharms.Features/Shop/Notifications/NotificationService.cs index 63eb992..928a131 100644 --- a/LiteCharms.Features/Shop/Notifications/NotificationService.cs +++ b/LiteCharms.Features/Shop/Notifications/NotificationService.cs @@ -97,12 +97,8 @@ public class NotificationService(IDbContextFactory contextFactory notification.Processed = request.Processed; notification.UpdatedAt = DateTime.UtcNow; - - if (request.HasError) - { - notification.HasError = request.HasError; - notification.Errors = request.Errors; - } + notification.HasError = request.HasError; + notification.Errors = request.Errors; return await context.SaveChangesAsync(cancellationToken) > 0 ? Result.Ok()