mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Remove unused code (#6152)
This commit is contained in:
@@ -1079,18 +1079,6 @@ namespace BTCPayServer.Controllers
|
|||||||
catch { try { webSocket.Dispose(); } catch { } }
|
catch { try { webSocket.Dispose(); } catch { } }
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("i/{invoiceId}/UpdateCustomer")]
|
|
||||||
[HttpPost("invoice/UpdateCustomer")]
|
|
||||||
public async Task<IActionResult> UpdateCustomer(string invoiceId, [FromBody] UpdateCustomerModel data)
|
|
||||||
{
|
|
||||||
if (!ModelState.IsValid)
|
|
||||||
{
|
|
||||||
return BadRequest(ModelState);
|
|
||||||
}
|
|
||||||
await _InvoiceRepository.UpdateInvoice(invoiceId, data).ConfigureAwait(false);
|
|
||||||
return Ok("{}");
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("/stores/{storeId}/invoices")]
|
[HttpGet("/stores/{storeId}/invoices")]
|
||||||
[HttpGet("invoices")]
|
[HttpGet("invoices")]
|
||||||
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewInvoices)]
|
[Authorize(AuthenticationSchemes = AuthenticationSchemes.Cookie, Policy = Policies.CanViewInvoices)]
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using BTCPayServer.Validation;
|
|
||||||
|
|
||||||
namespace BTCPayServer.Models.InvoicingModels
|
|
||||||
{
|
|
||||||
public class UpdateCustomerModel
|
|
||||||
{
|
|
||||||
[MailboxAddress]
|
|
||||||
[Required]
|
|
||||||
public string Email
|
|
||||||
{
|
|
||||||
get; set;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -140,35 +140,6 @@ namespace BTCPayServer.Services.Invoices
|
|||||||
return await ctx.Apps.Where(a => a.StoreDataId == storeId && a.TagAllInvoices).ToArrayAsync();
|
return await ctx.Apps.Where(a => a.StoreDataId == storeId && a.TagAllInvoices).ToArrayAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task UpdateInvoice(string invoiceId, UpdateCustomerModel data)
|
|
||||||
{
|
|
||||||
retry:
|
|
||||||
using (var ctx = _applicationDbContextFactory.CreateContext())
|
|
||||||
{
|
|
||||||
var invoiceData = await ctx.Invoices.FindAsync(invoiceId);
|
|
||||||
if (invoiceData == null)
|
|
||||||
return;
|
|
||||||
var blob = invoiceData.GetBlob();
|
|
||||||
if (blob.Metadata.BuyerEmail == null && data.Email != null)
|
|
||||||
{
|
|
||||||
if (MailboxAddressValidator.IsMailboxAddress(data.Email))
|
|
||||||
{
|
|
||||||
blob.Metadata.BuyerEmail = data.Email;
|
|
||||||
invoiceData.SetBlob(blob);
|
|
||||||
AddToTextSearch(ctx, invoiceData, blob.Metadata.BuyerEmail);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await ctx.SaveChangesAsync().ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (DbUpdateConcurrencyException)
|
|
||||||
{
|
|
||||||
goto retry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task UpdateInvoiceExpiry(string invoiceId, TimeSpan seconds)
|
public async Task UpdateInvoiceExpiry(string invoiceId, TimeSpan seconds)
|
||||||
{
|
{
|
||||||
retry:
|
retry:
|
||||||
|
|||||||
Reference in New Issue
Block a user