Refactoring query extraction from cookie into extender methods

This commit is contained in:
rockstardev
2020-07-28 10:28:19 -05:00
parent 466a0c6049
commit 19ffd031ec
3 changed files with 36 additions and 61 deletions

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using BTCPayServer.Controllers.Logic;
using BTCPayServer.Data;
using BTCPayServer.Events;
using BTCPayServer.Filters;
@@ -64,7 +63,7 @@ namespace BTCPayServer.Controllers
[BitpayAPIConstraint(false)]
public async Task<IActionResult> GetPaymentRequests(int skip = 0, int count = 50, string searchTerm = null, int? timezoneOffset = null)
{
ListCookiePreference.Parse(this, UserPrefCookieKeys.PaymentRequestsQuery, ref searchTerm, ref timezoneOffset);
this.PaymentRequestsQuery(ref searchTerm, ref timezoneOffset);
var includeArchived = new SearchString(searchTerm).GetFilterBool("includearchived") == true;
var result = await _PaymentRequestRepository.FindPaymentRequests(new PaymentRequestQuery()