Skip to content

Commit

Permalink
Minor changes - fix resource in AddressValidator.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
support committed Aug 25, 2023
1 parent 63ec198 commit 95499c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Web/Grand.Web/Validators/Common/AddressValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,35 +58,35 @@ public AddressValidator(
}
if (addressSettings.CompanyRequired && addressSettings.CompanyEnabled)
{
RuleFor(x => x.Company).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Company.Required"));
RuleFor(x => x.Company).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.Company.Required"));
}
if (addressSettings.VatNumberRequired && addressSettings.VatNumberEnabled)
{
RuleFor(x => x.VatNumber).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.VatNumber.Required"));
RuleFor(x => x.VatNumber).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.VatNumber.Required"));
}
if (addressSettings.StreetAddressRequired && addressSettings.StreetAddressEnabled)
{
RuleFor(x => x.Address1).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.StreetAddress.Required"));
RuleFor(x => x.Address1).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.StreetAddress.Required"));
}
if (addressSettings.StreetAddress2Required && addressSettings.StreetAddress2Enabled)
{
RuleFor(x => x.Address2).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.StreetAddress2.Required"));
RuleFor(x => x.Address2).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.StreetAddress2.Required"));
}
if (addressSettings.ZipPostalCodeRequired && addressSettings.ZipPostalCodeEnabled)
{
RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.ZipPostalCode.Required"));
RuleFor(x => x.ZipPostalCode).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.ZipPostalCode.Required"));
}
if (addressSettings.CityRequired && addressSettings.CityEnabled)
{
RuleFor(x => x.City).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.City.Required"));
RuleFor(x => x.City).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.City.Required"));
}
if (addressSettings.PhoneRequired && addressSettings.PhoneEnabled)
{
RuleFor(x => x.PhoneNumber).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Phone.Required"));
RuleFor(x => x.PhoneNumber).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.Phone.Required"));
}
if (addressSettings.FaxRequired && addressSettings.FaxEnabled)
{
RuleFor(x => x.FaxNumber).NotEmpty().WithMessage(translationService.GetResource("Account.Fields.Fax.Required"));
RuleFor(x => x.FaxNumber).NotEmpty().WithMessage(translationService.GetResource("Address.Fields.Fax.Required"));
}
RuleFor(x => x).CustomAsync(async (x, context, _) =>
{
Expand Down

0 comments on commit 95499c5

Please sign in to comment.