Redirect to payment requests page instead of edit page on archive action (#3142)

* Redirect to payment requests page instead of edit page on archive action

* Remove unused "using" directive
This commit is contained in:
Umar Bolatov
2021-11-24 03:27:56 -08:00
committed by GitHub
parent 11a9b10a54
commit 4fe4cdb7bf

View File

@@ -20,7 +20,6 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Routing;
using Newtonsoft.Json.Linq;
using PaymentRequestData = BTCPayServer.Data.PaymentRequestData;
using StoreData = BTCPayServer.Data.StoreData;
@@ -355,11 +354,11 @@ namespace BTCPayServer.Controllers
{
var model = (UpdatePaymentRequestViewModel)viewResult.Model;
model.Archived = !model.Archived;
result = await EditPaymentRequest(id, model);
await EditPaymentRequest(id, model);
TempData[WellKnownTempData.SuccessMessage] = model.Archived
? "The payment request has been archived and will no longer appear in the payment request list by default again."
: "The payment request has been unarchived and will appear in the payment request list by default.";
return result;
return RedirectToAction("GetPaymentRequests");
}
return NotFound();