File tree Expand file tree Collapse file tree 1 file changed +2
-20
lines changed
src/containers/Tenant/Query/QuerySettingsDialog Expand file tree Collapse file tree 1 file changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -33,26 +33,8 @@ import './QuerySettingsDialog.scss';
33
33
const b = cn ( 'ydb-query-settings-dialog' ) ;
34
34
35
35
const validationSchema = z . object ( {
36
- timeout : z . string ( ) . refine (
37
- ( value ) => {
38
- if ( ! value ) {
39
- return true ;
40
- }
41
- const num = Number ( value ) ;
42
- return ! isNaN ( num ) && num > 0 ;
43
- } ,
44
- { message : i18n ( 'form.validation.timeout' ) } ,
45
- ) ,
46
- limitRows : z . string ( ) . refine (
47
- ( value ) => {
48
- if ( ! value ) {
49
- return true ;
50
- }
51
- const num = Number ( value ) ;
52
- return ! isNaN ( num ) && num > 0 && num <= 100000 ;
53
- } ,
54
- { message : i18n ( 'form.validation.limitRows' ) } ,
55
- ) ,
36
+ timeout : z . coerce . number ( ) . positive ( ) . optional ( ) . or ( z . string ( ) . length ( 0 ) ) ,
37
+ limitRows : z . coerce . number ( ) . gt ( 0 ) . lte ( 10_000 ) . optional ( ) . or ( z . string ( ) . length ( 0 ) ) ,
56
38
queryMode : z . custom < QueryMode > ( ) ,
57
39
transactionMode : z . custom < TransactionMode > ( ) ,
58
40
statisticsMode : z . custom < StatisticsMode > ( ) . optional ( ) ,
You can’t perform that action at this time.
0 commit comments