mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-23 07:04:26 +01:00
This commit is contained in:
@@ -88,6 +88,10 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
ModelState.AddModelError(nameof(vm.PerksTemplate), "Invalid template");
|
||||
}
|
||||
if (vm.TargetAmount is decimal v && v == 0.0m)
|
||||
{
|
||||
vm.TargetAmount = null;
|
||||
}
|
||||
|
||||
if (Enum.Parse<CrowdfundResetEvery>(vm.ResetEvery) != CrowdfundResetEvery.Never && !vm.StartDate.HasValue)
|
||||
{
|
||||
|
||||
@@ -12,7 +12,21 @@ namespace BTCPayServer.Services.Apps
|
||||
public DateTime? EndDate { get; set; }
|
||||
|
||||
public string TargetCurrency { get; set; }
|
||||
public decimal? TargetAmount { get; set; }
|
||||
decimal? _TargetAmount;
|
||||
public decimal? TargetAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
// In the past, target amount might have been 0, creating exception
|
||||
if (_TargetAmount is decimal v && v == 0.0m)
|
||||
return null;
|
||||
return _TargetAmount;
|
||||
}
|
||||
set
|
||||
{
|
||||
_TargetAmount = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool EnforceTargetAmount { get; set; }
|
||||
public string CustomCSSLink { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user