mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Archive stores and apps (#5296)
* Add flags and migration * Archive store * Archive apps
This commit is contained in:
@@ -680,6 +680,7 @@ namespace BTCPayServer.Controllers
|
||||
InvoiceExpiration = (int)storeBlob.InvoiceExpiration.TotalMinutes,
|
||||
DefaultCurrency = storeBlob.DefaultCurrency,
|
||||
BOLT11Expiration = (long)storeBlob.RefundBOLT11Expiration.TotalDays,
|
||||
Archived = store.Archived,
|
||||
CanDelete = _Repo.CanDeleteStores()
|
||||
};
|
||||
|
||||
@@ -827,6 +828,23 @@ namespace BTCPayServer.Controllers
|
||||
});
|
||||
}
|
||||
|
||||
[HttpPost("{storeId}/archive")]
|
||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanModifyStoreSettings)]
|
||||
public async Task<IActionResult> ToggleArchive(string storeId)
|
||||
{
|
||||
CurrentStore.Archived = !CurrentStore.Archived;
|
||||
await _Repo.UpdateStore(CurrentStore);
|
||||
|
||||
TempData[WellKnownTempData.SuccessMessage] = CurrentStore.Archived
|
||||
? "The store has been archived and will no longer appear in the stores list by default."
|
||||
: "The store has been unarchived and will appear in the stores list by default again.";
|
||||
|
||||
return RedirectToAction(nameof(GeneralSettings), new
|
||||
{
|
||||
storeId = CurrentStore.Id
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("{storeId}/delete")]
|
||||
public IActionResult DeleteStore(string storeId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user