Refactor plugin apps (#4780)

* Refactor plugins

* Add missing names to view models

* Cleanups

* Replace SalesAppBaseType by two interfaces

---------

Co-authored-by: Dennis Reimann <mail@dennisreimann.de>
This commit is contained in:
Nicolas Dorier
2023-03-20 10:39:26 +09:00
committed by GitHub
parent 53f3758abc
commit 04ba1430ca
28 changed files with 163 additions and 160 deletions

View File

@@ -124,8 +124,8 @@ namespace BTCPayServer.Controllers
{
var store = GetCurrentStore();
vm.StoreId = store.Id;
var types = _appService.GetAvailableAppTypes();
if (!types.ContainsKey(vm.SelectedAppType))
var type = _appService.GetAppType(vm.SelectedAppType);
if (type is null)
ModelState.AddModelError(nameof(vm.SelectedAppType), "Invalid App Type");
if (!ModelState.IsValid)
@@ -147,7 +147,8 @@ namespace BTCPayServer.Controllers
TempData[WellKnownTempData.SuccessMessage] = "App successfully created";
CreatedAppId = appData.Id;
var url = await _appService.ConfigureLink(appData, vm.SelectedAppType);
var url = await type.ConfigureLink(appData);
return Redirect(url);
}