mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Redirect create and edit payment request to list view upon completion
Create and edit now redirect to list view. Both actions use the same method. Also updated notification message. Kept extraneous redirect value for xUnit tests. Update selenium test to account for redirect to list view.
This commit is contained in:
committed by
Andrew Camilleri
parent
ce85bd26df
commit
9d75225bd5
@@ -139,7 +139,8 @@ namespace BTCPayServer.Controllers
|
||||
blob.AllowCustomPaymentAmounts = viewModel.AllowCustomPaymentAmounts;
|
||||
|
||||
data.SetBlob(blob);
|
||||
if (string.IsNullOrEmpty(payReqId))
|
||||
var isNewPaymentRequest = string.IsNullOrEmpty(payReqId);
|
||||
if (isNewPaymentRequest)
|
||||
{
|
||||
data.Created = DateTimeOffset.UtcNow;
|
||||
}
|
||||
@@ -147,8 +148,8 @@ namespace BTCPayServer.Controllers
|
||||
data = await _PaymentRequestRepository.CreateOrUpdatePaymentRequest(data);
|
||||
_EventAggregator.Publish(new PaymentRequestUpdated { Data = data, PaymentRequestId = data.Id, });
|
||||
|
||||
TempData[WellKnownTempData.SuccessMessage] = "Saved";
|
||||
return RedirectToAction(nameof(EditPaymentRequest), new { storeId = store.Id, payReqId = data.Id });
|
||||
TempData[WellKnownTempData.SuccessMessage] = $"Payment request [{viewModel.Title}] {(isNewPaymentRequest ? "created" : "updated")} successfully";
|
||||
return RedirectToAction(nameof(GetPaymentRequests), new { storeId = store.Id, payReqId = data.Id });
|
||||
}
|
||||
|
||||
[HttpGet("{payReqId}")]
|
||||
|
||||
Reference in New Issue
Block a user