read not
This commit is contained in:
@@ -1,11 +1,25 @@
|
||||
@using Shared.DTOs
|
||||
<h3>Notifications</h3>
|
||||
<h3>@items.Count()</h3>
|
||||
@using Front.Services
|
||||
@using Shared.DTOs
|
||||
@inject HttpClientController hc;
|
||||
@inject Fixedvalues fv;
|
||||
@foreach (var item in items)
|
||||
{
|
||||
<Alert OnClosed="()=>OnClosedAlert(item)" Color="(AlertColor)Enum.Parse(typeof(AlertColor), item.Status.ToString())" Dismissable="true"> @item.Message </Alert>
|
||||
}
|
||||
|
||||
<Alert Color="AlertColor.Warning" Dismissable="true"> <strong>Holy guacamole!</strong> You should check in on some of those fields below. </Alert>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter] public List<AlertDTO> items { get; set; }
|
||||
public async Task OnClosedAlert(AlertDTO nt)
|
||||
{
|
||||
var rsp= await hc.Put($"User/ReadNotification/{Convert.ToInt32(nt.ViewSize)}");
|
||||
// if (rsp.IsSuccessStatusCode)
|
||||
// {
|
||||
// fv.dashBoard.Notifications.Remove(nt);
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -166,11 +166,15 @@
|
||||
</ul>
|
||||
</li>
|
||||
<!--/ User -->
|
||||
<li class="nav-item lh-1 me-3 f-ir">
|
||||
<Button Type="ButtonType.Button" @onclick="ShowNotifications" Color="ButtonColor.None">
|
||||
<Badge Color="BadgeColor.Danger"><Icon Name="IconName.MegaphoneFill" /> @dashBoard?.Notifications.Count()</Badge>
|
||||
</Button>
|
||||
</li>
|
||||
@if (dashBoard?.Notifications.Count()>0)
|
||||
{
|
||||
<li class="nav-item lh-1 me-3 f-ir">
|
||||
<Button Type="ButtonType.Button" @onclick="ShowNotifications" Color="ButtonColor.None">
|
||||
<Badge Color="BadgeColor.Danger"><Icon Name="IconName.MegaphoneFill" /> @dashBoard?.Notifications.Count()</Badge>
|
||||
</Button>
|
||||
</li>
|
||||
}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
@@ -34,9 +34,9 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
}) ;
|
||||
|
||||
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||
|
||||
|
Reference in New Issue
Block a user