Use razor component to encapsulate UI logic

This commit is contained in:
nicolas.dorier
2020-08-12 16:02:13 +09:00
parent 10d6e44a38
commit 5c9d0fd40a
13 changed files with 196 additions and 156 deletions

View File

@@ -15,22 +15,6 @@ using Microsoft.AspNetCore.Mvc;
namespace BTCPayServer.Controllers
{
public class NotificationsDropdown : ViewComponent
{
private readonly NotificationManager _notificationManager;
public NotificationsDropdown(NotificationManager notificationManager)
{
_notificationManager = notificationManager;
}
public async Task<IViewComponentResult> InvokeAsync(int noOfEmployee)
{
return View(await _notificationManager.GetSummaryNotifications(UserClaimsPrincipal));
}
}
[BitpayAPIConstraint(false)]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie)]
[Route("[controller]/[action]")]