Skip to content

Commit 7236ecb

Browse files
committed
refactor(Unique{Category,Country}NameValidator): simplify.
No functional changes.
1 parent e3cc3d2 commit 7236ecb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/main/java/ru/mystamps/web/feature/category/UniqueCategoryNameValidator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ public boolean isValid(String value, ConstraintValidatorContext ctx) {
4545

4646
if (lang == Lang.EN && categoryService.countByName(value) > 0) {
4747
return false;
48+
}
4849

49-
} else if (lang == Lang.RU && categoryService.countByNameRu(value) > 0) {
50+
if (lang == Lang.RU && categoryService.countByNameRu(value) > 0) {
5051
return false;
5152
}
5253

src/main/java/ru/mystamps/web/feature/country/UniqueCountryNameValidator.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ public boolean isValid(String value, ConstraintValidatorContext ctx) {
4444

4545
if (lang == Lang.EN && countryService.countByName(value) > 0) {
4646
return false;
47+
}
4748

48-
} else if (lang == Lang.RU && countryService.countByNameRu(value) > 0) {
49+
if (lang == Lang.RU && countryService.countByNameRu(value) > 0) {
4950
return false;
5051
}
5152

0 commit comments

Comments
 (0)