Skip to content

Commit

Permalink
added character limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
akanshaaa19 committed Feb 17, 2025
1 parent 5687a6c commit 95b4a87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/containers/WaGroups/WaPolls/WaPolls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ export const WaPolls = () => {

const FormSchema = Yup.object().shape({
label: Yup.string().required(t('Title is required.')).max(50, t('Title is too long.')),
content: Yup.string().required('Content is required.').max(150, 'Content is too long.'),
content: Yup.string().required('Content is required.').max(255, 'Content is too long.'),
options: Yup.array()
.of(Yup.object().shape({ name: Yup.string().required('Option is required.') }))
.of(
Yup.object().shape({
name: Yup.string().required('Option is required.').max(100, 'Please enter not more than 100 characters'),
})
)
.test('unique-values', 'Values must be unique', (array: any) => {
const values = array.map((item: any) => item.name);
return new Set(values).size === values.length;
Expand Down

0 comments on commit 95b4a87

Please sign in to comment.