Greenfield: Manage notifications (#6058)

Prerequisite for btcpayserver/app#12.
This commit is contained in:
d11n
2024-06-25 20:01:11 +02:00
committed by GitHub
parent e0c5ac5271
commit feffbbd980
7 changed files with 306 additions and 3 deletions

View File

@@ -22,7 +22,6 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using NBitcoin;
using NBXplorer.DerivationStrategy;
using NBXplorer.Models;
using Newtonsoft.Json.Linq;
using InvoiceData = BTCPayServer.Client.Models.InvoiceData;
@@ -644,6 +643,18 @@ namespace BTCPayServer.Controllers.Greenfield
HandleActionResult(await GetController<GreenfieldApiKeysController>().RevokeAPIKey(apikey));
}
public override async Task<NotificationSettingsData> GetNotificationSettings(CancellationToken token = default)
{
return GetFromActionResult<NotificationSettingsData>(
await GetController<GreenfieldNotificationsController>().GetNotificationSettings());
}
public override async Task<NotificationSettingsData> UpdateNotificationSettings(UpdateNotificationSettingsRequest request, CancellationToken token = default)
{
return GetFromActionResult<NotificationSettingsData>(
await GetController<GreenfieldNotificationsController>().UpdateNotificationSettings(request));
}
public override async Task<IEnumerable<NotificationData>> GetNotifications(bool? seen = null,
int? skip = null, int? take = null, CancellationToken token = default)
{