Skip to content

Commit

Permalink
Fix more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NixFey committed Jul 27, 2024
1 parent 6a1dbaa commit 33caa7b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Hubs/AssistantHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public async Task GetStreamInfo()

private async Task SendPendingAlertsToCaller()
{
var pendingAlerts = await dbContext.AlertCarts.Where(ac => ac.CartId == CartId && ac.ReadTime == null)
.Select(ac => ac.Alert).ToListAsync();
// var pendingAlerts = await dbContext.AlertCarts.Where(ac => ac.CartId == CartId && ac.ReadTime == null)
// .Select(ac => ac.Alert).ToListAsync();
var pendingAlerts = new List<Alert>();

await Clients.Caller.SendAsync("PendingAlerts", pendingAlerts);
}
Expand Down
8 changes: 4 additions & 4 deletions Models/Cart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Cart : BaseEquipment
public AvCartConfiguration? Configuration { get; set; } = new();

// TODO: This is not yet implemented in Postgres
public ICollection<AlertCart>? AlertCarts { get; set; }
// public ICollection<AlertCart>? AlertCarts { get; set; }

public class AvCartConfiguration
{
Expand All @@ -25,9 +25,9 @@ public class CartEntityTypeConfiguration : BaseEquipmentEntityTypeConfiguration<
{
protected override void ConfigureEntity(EntityTypeBuilder<Cart> builder)
{
builder
.HasMany(a => a.AlertCarts)
.WithOne(ac => ac.Cart);
// builder
// .HasMany(a => a.AlertCarts)
// .WithOne(ac => ac.Cart);
builder.HasQueryFilter(c => c.EquipmentType == EquipmentType.AvCart);
builder.OwnsOne(c => c.Configuration, d =>
{
Expand Down
5 changes: 3 additions & 2 deletions Services/AssistantService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public async Task SendPendingAlertsToEveryone()
var hubContext = serviceProvider.GetRequiredService<IHubContext<AssistantHub>>();
var dbContext = serviceProvider.GetRequiredService<FimDbContext>();

var pendingAlerts = await dbContext.AlertCarts.Where(ac => ac.ReadTime == null)
.GroupBy(k => k.CartId, v => v.Alert).ToListAsync();
// var pendingAlerts = await dbContext.AlertCarts.Where(ac => ac.ReadTime == null)
// .GroupBy(k => k.CartId, v => v.Alert).ToListAsync();
var pendingAlerts = new List<IGrouping<Guid, Alert>>();

foreach (var group in pendingAlerts)
{
Expand Down

0 comments on commit 33caa7b

Please sign in to comment.