Skip to content

Commit e55c633

Browse files
committed
fix: review fix
1 parent df16b2d commit e55c633

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

src/containers/Tenant/Query/QuerySettingsDialog/QuerySettingsDialog.tsx

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,8 @@ import './QuerySettingsDialog.scss';
3333
const b = cn('ydb-query-settings-dialog');
3434

3535
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)),
5638
queryMode: z.custom<QueryMode>(),
5739
transactionMode: z.custom<TransactionMode>(),
5840
statisticsMode: z.custom<StatisticsMode>().optional(),

0 commit comments

Comments
 (0)