Fix nil weight check upon form submission.

Commit
922ae48fab94e8f52de121ba049485755f4dbbd7
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
src/MyFitnessTracker-Components/MFTWeightForm.class.st
index 33d3f51a..d5f989b3 100644..100644
@@ -29,7 +29,6 @@
29 29 html dateInput5 formControl
30 30 placeholder: 'RequiredEntry-PutItAndDoNotUse';
31 31 callback: [ :input |
32 Removed: input ifEmpty: [ self error: 'Workout date required.' ].
33 32 weight date: (Date readFrom: input pattern: 'yyyy-mm-dd') ];
34 33 value: weight date yyyymmdd.
35 34 html label: 'Date' ] ].
@@ -41,9 +40,7 @@
41 40 with: [
42 41 html numberInput formControl
43 42 placeholder: 'RequiredEntry-PutItAndDoNotUse';
44 Removed: callback: [ :input |
45 Removed: input ifEmpty: [ self error: 'Weight value required.' ].
46 Removed: weight value: input ];
43 Added: callback: [ :input | input ifNotEmpty: [ weight value: input ] ];
47 44 value: weight value.
48 45 html label: 'Weight' ] ] ]
49 46 ]
@@ -51,7 +48,9 @@
51 48 { #category : 'as yet unclassified' }
52 49 MFTWeightForm >> submitForm [
53 50
54 Removed: self answer: weight
51 Added: weight value
52 Added: ifNotNil: [ self answer: weight ]
53 Added: ifNil: [ self answer: nil ]
55 54 ]
56 55
57 56 { #category : 'accessing' }