fixed Newsletter Page displaying distribution for deleted articles
This commit is contained in:
parent
8d0a21c833
commit
791a11d053
|
@ -67,7 +67,6 @@
|
||||||
await using var context = await ContextFactory.CreateDbContextAsync();
|
await using var context = await ContextFactory.CreateDbContextAsync();
|
||||||
|
|
||||||
Newsletters = await context.Set<EmailNewsletter>()
|
Newsletters = await context.Set<EmailNewsletter>()
|
||||||
.IgnoreQueryFilters().IgnoreAutoIncludes()
|
|
||||||
.Include(n => n.Article)
|
.Include(n => n.Article)
|
||||||
.OrderByDescending(n => n.DistributionDateTime)
|
.OrderByDescending(n => n.DistributionDateTime)
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
|
|
|
@ -95,6 +95,7 @@ public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options
|
||||||
newsletter.Property(a => a.DistributionDateTime)
|
newsletter.Property(a => a.DistributionDateTime)
|
||||||
.HasConversion(dateTimeOffsetUtcConverter);
|
.HasConversion(dateTimeOffsetUtcConverter);
|
||||||
|
|
||||||
|
newsletter.HasQueryFilter(n => !n.Article.IsDeleted);
|
||||||
newsletter.ToTable("Newsletter");
|
newsletter.ToTable("Newsletter");
|
||||||
});
|
});
|
||||||
builder.Entity<EmailSubscriber>(subscriber => {
|
builder.Entity<EmailSubscriber>(subscriber => {
|
||||||
|
|
Loading…
Reference in a new issue