From 613dd3963f2e49b35089580e9e5a813a459cd497 Mon Sep 17 00:00:00 2001 From: Andy Espagnolo Date: Wed, 27 Sep 2023 16:46:27 -0300 Subject: [PATCH] fix: draft title validation (#1298) --- src/entities/Proposal/types.ts | 4 ++-- src/pages/submit/draft.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/entities/Proposal/types.ts b/src/entities/Proposal/types.ts index 9bd6cc879..e134cbda3 100644 --- a/src/entities/Proposal/types.ts +++ b/src/entities/Proposal/types.ts @@ -274,7 +274,7 @@ export const newProposalDraftScheme = { }, title: { type: 'string', - minLength: 1, + minLength: 5, maxLength: 80, }, summary: { @@ -341,7 +341,7 @@ export const newProposalGovernanceScheme = { }, title: { type: 'string', - minLength: 1, + minLength: 5, maxLength: 80, }, summary: { diff --git a/src/pages/submit/draft.tsx b/src/pages/submit/draft.tsx index 25771d2e4..cba16278e 100644 --- a/src/pages/submit/draft.tsx +++ b/src/pages/submit/draft.tsx @@ -137,8 +137,8 @@ export default function SubmitDraftProposal() { name="title" rules={{ required: { value: true, message: t('error.draft.title_empty') }, - min: { value: schema.title.minLength, message: t('error.draft.title_too_short') }, - max: { value: schema.title.maxLength, message: t('error.draft.title_too_long') }, + minLength: { value: schema.title.minLength, message: t('error.draft.title_too_short') }, + maxLength: { value: schema.title.maxLength, message: t('error.draft.title_too_large') }, }} error={!!errors.title} loading={isLoadingVpDistribution}