Merge pull request #1742 from bolatovumar/feat/1709

Allow mass-archiving of invoices
This commit is contained in:
Nicolas Dorier
2020-07-15 12:27:25 +09:00
committed by GitHub
3 changed files with 353 additions and 291 deletions

View File

@@ -291,6 +291,24 @@ namespace BTCPayServer.Controllers
return RedirectToAction(nameof(invoice), new { invoiceId });
}
[HttpPost]
public async Task<IActionResult> MassAction(string command, string[] selectedItems)
{
if (selectedItems != null)
{
switch (command)
{
case "archive":
await _InvoiceRepository.MassArchive(selectedItems);
TempData[WellKnownTempData.SuccessMessage] = $"{selectedItems.Length} invoice(s) archived.";
break;
}
}
return RedirectToAction(nameof(ListInvoices));
}
[HttpGet]
[Route("i/{invoiceId}")]
[Route("i/{invoiceId}/{paymentMethodId}")]