mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
set viewbag on method result instead
This commit is contained in:
parent
6cab02cd99
commit
477ab67fe9
1 changed files with 4 additions and 4 deletions
|
@ -461,7 +461,7 @@ namespace BTCPayServer.Controllers
|
||||||
public async Task<IActionResult> Policies()
|
public async Task<IActionResult> Policies()
|
||||||
{
|
{
|
||||||
var data = (await _SettingsRepository.GetSettingAsync<PoliciesSettings>()) ?? new PoliciesSettings();
|
var data = (await _SettingsRepository.GetSettingAsync<PoliciesSettings>()) ?? new PoliciesSettings();
|
||||||
await GetAppSelectList();
|
ViewBag.AppsList = await GetAppSelectList();
|
||||||
return View(data);
|
return View(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ namespace BTCPayServer.Controllers
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<IActionResult> Policies(PoliciesSettings settings, string command = "")
|
public async Task<IActionResult> Policies(PoliciesSettings settings, string command = "")
|
||||||
{
|
{
|
||||||
await GetAppSelectList();
|
ViewBag.AppsList = await GetAppSelectList();
|
||||||
if (command == "add-domain")
|
if (command == "add-domain")
|
||||||
{
|
{
|
||||||
ModelState.Clear();
|
ModelState.Clear();
|
||||||
|
@ -575,7 +575,7 @@ namespace BTCPayServer.Controllers
|
||||||
return View(result);
|
return View(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task GetAppSelectList()
|
private async Task<List<SelectListItem>> GetAppSelectList()
|
||||||
{
|
{
|
||||||
// load display app dropdown
|
// load display app dropdown
|
||||||
using (var ctx = _ContextFactory.CreateContext())
|
using (var ctx = _ContextFactory.CreateContext())
|
||||||
|
@ -587,7 +587,7 @@ namespace BTCPayServer.Controllers
|
||||||
.SelectMany(s => s.Apps)
|
.SelectMany(s => s.Apps)
|
||||||
.Select(a => new SelectListItem($"{a.AppType} - {a.Name}", a.Id)).ToListAsync();
|
.Select(a => new SelectListItem($"{a.AppType} - {a.Name}", a.Id)).ToListAsync();
|
||||||
selectList.Insert(0, new SelectListItem("(None)", null));
|
selectList.Insert(0, new SelectListItem("(None)", null));
|
||||||
ViewBag.AppsList = selectList;
|
return selectList;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue