Skip to content

Commit 882bcbf

Browse files
committed
refactor: District 를 이름을 통해서 특정 값을 고를 때, 앞뒤 공백 허용
1 parent 2567bc6 commit 882bcbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/eatda/domain/store/District.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ public enum District {
4141
}
4242

4343
public static District fromName(String name) {
44+
if (name == null || name.isEmpty()) {
45+
return ETC;
46+
}
4447
return Arrays.stream(District.values())
45-
.filter(district -> district.name.equals(name))
48+
.filter(district -> district.name.equals(name.trim()))
4649
.findFirst()
4750
.orElse(ETC);
4851
}

0 commit comments

Comments
 (0)