File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
src/components/dialogs/limits Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -53,20 +53,9 @@ const temporaryLimitsValidationSchema = () => {
53
53
} ;
54
54
55
55
const currentLimitsValidationSchema = ( isModification = false ) => ( {
56
- [ PERMANENT_LIMIT ] : yup
57
- . number ( )
58
- . nullable ( )
59
- . positive ( 'permanentCurrentLimitMustBeGreaterThanZero' )
60
- // if there are valid (named) temporary limits, permanent limit is mandatory
61
- . when ( [ TEMPORARY_LIMITS ] , {
62
- is : ( temporaryLimits : TemporaryLimit [ ] ) =>
63
- temporaryLimits ?. length > 0 && temporaryLimits . find ( ( limit ) => limit . name ) && ! isModification ,
64
- then : ( ) =>
65
- yup
66
- . number ( )
67
- . required ( 'permanentCurrentLimitMandatory' )
68
- . positive ( 'permanentCurrentLimitMustBeGreaterThanZero' ) ,
69
- } ) ,
56
+ [ PERMANENT_LIMIT ] : isModification
57
+ ? yup . number ( ) . nullable ( ) . positive ( 'permanentCurrentLimitMustBeGreaterThanZero' )
58
+ : yup . number ( ) . positive ( 'permanentCurrentLimitMustBeGreaterThanZero' ) . required ( ) ,
70
59
[ TEMPORARY_LIMITS ] : yup
71
60
. array ( )
72
61
. of ( temporaryLimitsValidationSchema ( ) )
You can’t perform that action at this time.
0 commit comments