fixed Newsletter Page displaying distribution for deleted articles

This commit is contained in:
Mia Rose Winter 2024-03-14 14:23:29 +01:00
parent 8d0a21c833
commit 791a11d053
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 1 additions and 1 deletions

View file

@ -67,7 +67,6 @@
await using var context = await ContextFactory.CreateDbContextAsync();
Newsletters = await context.Set<EmailNewsletter>()
.IgnoreQueryFilters().IgnoreAutoIncludes()
.Include(n => n.Article)
.OrderByDescending(n => n.DistributionDateTime)
.ToListAsync();

View file

@ -95,6 +95,7 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
newsletter.Property(a => a.DistributionDateTime)
.HasConversion(dateTimeOffsetUtcConverter);
newsletter.HasQueryFilter(n => !n.Article.IsDeleted);
newsletter.ToTable("Newsletter");
});
builder.Entity<EmailSubscriber>(subscriber => {