Skip to content

Commit 1e95231

Browse files
committed
fix: trim catalog numbers when we update a series
Fix #1447
1 parent a5bed04 commit 1e95231

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/ru/mystamps/web/support/spring/mvc/PatchRequest.java

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import lombok.Getter;
2222
import lombok.Setter;
2323
import lombok.ToString;
24+
import org.apache.commons.lang3.StringUtils;
2425

2526
import javax.validation.constraints.NotEmpty;
2627
import javax.validation.constraints.NotNull;
@@ -47,6 +48,12 @@ public enum Operation {
4748
// @todo #785 Update series: add integration test for non-empty "value" field
4849
@NotEmpty
4950
private String value;
51+
52+
// @initBinder with StringTrimmerEditor() doesn't work with @RequestBody, so we do that manually
53+
// @todo #1447 Add test to ensure that catalog numbers are trimmed
54+
public void setValue(String value) {
55+
this.value = StringUtils.trimToNull(value);
56+
}
5057

5158
public Integer integerValue() {
5259
return Integer.valueOf(value);

0 commit comments

Comments
 (0)