Fix prese tutte le ispezioni legate all'utente

This commit is contained in:
2026-03-05 16:53:05 +01:00
parent e57738a37f
commit 0abe88939b
4 changed files with 10 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ public class SteupDataService(
private async Task CleanOldClosedInspection()
{
var ispezioni = (await ispezioniService.GetAllIspezioniWithSchedeAsync())
var ispezioni = (await ispezioniService.GetAllIspezioniWithSchedeAsync(userSession.User.Username))
.Where(x =>
x.Stato == StatusEnum.Completata &&
x.Data < DateTime.Now.AddDays(-60)
@@ -53,7 +53,7 @@ public class SteupDataService(
public async Task CheckAndUpdateStatus()
{
var ispezioni = await ispezioniService.GetAllIspezioniWithSchedeAsync();
var ispezioni = await ispezioniService.GetAllIspezioniWithSchedeAsync(userSession.User.Username);
var listActivityId = ispezioni
.Where(x => x.ActivityId != null)
.Select(x => x.ActivityId!)
@@ -95,7 +95,7 @@ public class SteupDataService(
public async Task<bool> CanOpenNewInspection()
{
var completedInspection = await ispezioniService.GetAllIspezioni();
var completedInspection = await ispezioniService.GetAllIspezioni(userSession.User.Username);
if (completedInspection.IsNullOrEmpty()) return true;