Archive stores and apps (#5296)

* Add flags and migration

* Archive store

* Archive apps
This commit is contained in:
d11n
2023-09-11 02:59:17 +02:00
committed by GitHub
parent 089e16020e
commit 57bc90ad03
40 changed files with 545 additions and 114 deletions

View File

@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Client;
using BTCPayServer.Data;
using BTCPayServer.Models;
using BTCPayServer.Models.StoreViewModels;
using BTCPayServer.Rating;
using BTCPayServer.Services.Rates;
@@ -37,6 +35,26 @@ namespace BTCPayServer.Controllers
_rateFactory = rateFactory;
}
[HttpGet()]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanModifyStoreSettingsUnscoped)]
public async Task<IActionResult> ListStores(bool archived = false)
{
var stores = await _repo.GetStoresByUserId(GetUserId());
var vm = new ListStoresViewModel
{
Stores = stores
.Where(s => s.Archived == archived)
.Select(s => new ListStoresViewModel.StoreViewModel
{
StoreId = s.Id,
StoreName = s.StoreName,
Archived = s.Archived
}).ToList(),
Archived = archived
};
return View(vm);
}
[HttpGet("create")]
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanModifyStoreSettingsUnscoped)]
public async Task<IActionResult> CreateStore(bool skipWizard)