diff --git a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs index e678f5513..2613eb271 100644 --- a/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs +++ b/BTCPayServer/Models/AppViewModels/UpdateCrowdfundViewModel.cs @@ -46,6 +46,7 @@ namespace BTCPayServer.Models.AppViewModels public string TargetCurrency { get; set; } = "BTC"; [Display(Name = "Set a Target amount ")] + [Range(0, double.PositiveInfinity)] public decimal? TargetAmount { get; set; } diff --git a/BTCPayServer/Models/PaymentRequestViewModels/ListPaymentRequestsViewModel.cs b/BTCPayServer/Models/PaymentRequestViewModels/ListPaymentRequestsViewModel.cs index 919bd5b2c..2bcc31fdd 100644 --- a/BTCPayServer/Models/PaymentRequestViewModels/ListPaymentRequestsViewModel.cs +++ b/BTCPayServer/Models/PaymentRequestViewModels/ListPaymentRequestsViewModel.cs @@ -48,7 +48,7 @@ namespace BTCPayServer.Models.PaymentRequestViewModels public string Id { get; set; } [Required] public string StoreId { get; set; } - [Required] public decimal Amount { get; set; } + [Required][Range(0, double.PositiveInfinity)]public decimal Amount { get; set; } [Display(Name = "The currency used for payment request. (e.g. BTC, LTC, USD, etc.)")] public string Currency { get; set; } diff --git a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml index 576e6d175..b81e7ec30 100644 --- a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml @@ -1,4 +1,4 @@ -@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers +@addTagHelper *, Meziantou.AspNetCore.BundleTagHelpers @model UpdateCrowdfundViewModel @{ ViewData["Title"] = "Update Crowdfund"; @@ -67,8 +67,8 @@