Add the StoreScope

This commit is contained in:
nicolas.dorier
2020-06-15 17:18:45 +09:00
parent d7eeadac41
commit aef5cc50d5
2 changed files with 10 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ namespace BTCPayServer.Services.Notifications
{
foreach (var uid in users)
{
var obj = JsonConvert.SerializeObject(this);
var obj = JsonConvert.SerializeObject(notification);
var data = new NotificationData
{
Id = Guid.NewGuid().ToString(),
@@ -67,6 +67,14 @@ namespace BTCPayServer.Services.Notifications
var admins = await _userManager.GetUsersInRoleAsync(Roles.ServerAdmin);
return admins.Select(a => a.Id).ToArray();
}
if (scope is StoreScope s)
{
using var ctx = _contextFactory.CreateContext();
return ctx.UserStore
.Where(u => u.StoreDataId == s.StoreId)
.Select(u => u.ApplicationUserId)
.ToArray();
}
throw new NotSupportedException("Notification scope not supported");
}
}

View File

@@ -2,6 +2,7 @@
@inject BTCPayServer.HostedServices.CssThemeManager themeManager
@{
ViewData["Title"] = "Log in";
Layout = "_LayoutWelcome";
}
@if (TempData.HasStatusMessage())
{