diff --git a/Wonky.Client/HttpRepository/ActivityHttpRepository.cs b/Wonky.Client/HttpRepository/ActivityHttpRepository.cs index 37b615a2..4835ba8d 100644 --- a/Wonky.Client/HttpRepository/ActivityHttpRepository.cs +++ b/Wonky.Client/HttpRepository/ActivityHttpRepository.cs @@ -56,10 +56,11 @@ public class ActivityHttpRepository : IActivityHttpRepository public async Task?> GetActivities(string activityDate) { var response = await _client - .GetAsync($"{_apiConfig.ActivityEndpoint}/date/{activityDate}") - ; + .GetAsync($"{_apiConfig.ActivityEndpoint}/date/{activityDate}"); var content = await response.Content.ReadAsStringAsync(); - //Console.WriteLine(content); + + Console.WriteLine(content); + return string.IsNullOrWhiteSpace(content) ? new List() : JsonSerializer.Deserialize>(content, _options); diff --git a/Wonky.Client/Program.cs b/Wonky.Client/Program.cs index 4da2f680..63649e41 100644 --- a/Wonky.Client/Program.cs +++ b/Wonky.Client/Program.cs @@ -51,6 +51,7 @@ builder.Services.Configure(builder.Configuration.GetSection("AppInfo")) builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); +builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddBlazoredLocalStorage(); diff --git a/Wonky.Client/Services/AuthenticationService.cs b/Wonky.Client/Services/AuthenticationService.cs index 6e2427ed..daea7ed0 100644 --- a/Wonky.Client/Services/AuthenticationService.cs +++ b/Wonky.Client/Services/AuthenticationService.cs @@ -103,9 +103,9 @@ namespace Wonky.Client.Services public async Task Logout() { - await _localStorage.ClearAsync(); ((AuthStateProvider)_authStateProvider).NotifyUserLogout(); _client.DefaultRequestHeaders.Authorization = null; + await _localStorage.ClearAsync(); } public async Task UserInfo(bool write = false) diff --git a/Wonky.Client/Shared/AuthStateProvider.cs b/Wonky.Client/Shared/AuthStateProvider.cs index 238e1756..99a153e8 100644 --- a/Wonky.Client/Shared/AuthStateProvider.cs +++ b/Wonky.Client/Shared/AuthStateProvider.cs @@ -103,7 +103,6 @@ namespace Wonky.Client.Shared public void NotifyUserLogout() { var authState = Task.FromResult(_anonymous); - NotifyAuthenticationStateChanged(authState); } diff --git a/Wonky.Client/Shared/MainLayout.razor b/Wonky.Client/Shared/MainLayout.razor index f48baa85..318471cb 100644 --- a/Wonky.Client/Shared/MainLayout.razor +++ b/Wonky.Client/Shared/MainLayout.razor @@ -30,8 +30,8 @@
@Body
- diff --git a/Wonky.Entity/DTO/ReportActivityDto.cs b/Wonky.Entity/DTO/ReportActivityDto.cs index 78358315..1aefbd66 100644 --- a/Wonky.Entity/DTO/ReportActivityDto.cs +++ b/Wonky.Entity/DTO/ReportActivityDto.cs @@ -2,7 +2,7 @@ namespace Wonky.Entity.DTO; public class ReportActivityDto { - public ReportVisitDto ReportVisitDto { get; set; } = new(); + public ReportVisitDto Company { get; set; } = new(); public string SalesHeadId { get; set; } = ""; public bool Closed { get; set; } public string OrderDate { get; set; } = "";