mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user