mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Add "Mark all as seen" button to notification dropdown (#2101)
This commit is contained in:
@@ -206,6 +206,17 @@ namespace BTCPayServer.Controllers
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> MarkAllAsSeen(string returnUrl)
|
||||
{
|
||||
if (!ValidUserClaim(out var userId))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
await _notificationManager.ToggleSeen(new NotificationsQuery() {Seen = false, UserId = userId}, true);
|
||||
return Redirect(returnUrl);
|
||||
}
|
||||
|
||||
private bool ValidUserClaim(out string userId)
|
||||
{
|
||||
userId = _userManager.GetUserId(User);
|
||||
|
||||
Reference in New Issue
Block a user