mirror of
https://github.com/bitwarden/server
synced 2025-12-29 06:33:43 +00:00
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)" This reverts commit239286737d. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a.
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Bit.Api.Models.Request.Accounts;
|
||||
|
||||
public class TaxInfoUpdateRequestModel : IValidatableObject
|
||||
namespace Bit.Api.Models.Request.Accounts
|
||||
{
|
||||
[Required]
|
||||
public string Country { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
public class TaxInfoUpdateRequestModel : IValidatableObject
|
||||
{
|
||||
if (Country == "US" && string.IsNullOrWhiteSpace(PostalCode))
|
||||
[Required]
|
||||
public string Country { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
|
||||
public virtual IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield return new ValidationResult("Zip / postal code is required.",
|
||||
new string[] { nameof(PostalCode) });
|
||||
if (Country == "US" && string.IsNullOrWhiteSpace(PostalCode))
|
||||
{
|
||||
yield return new ValidationResult("Zip / postal code is required.",
|
||||
new string[] { nameof(PostalCode) });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user