Skip to content
Snippets Groups Projects
Unverified Commit 56dbb005 authored by alihadi-mazeh's avatar alihadi-mazeh Committed by GitHub
Browse files

Added a type error validation for Roles Permission > Room limit (#4897)

* Added a type error validation

* Localized latest change
parent cf7d1e13
No related branches found
No related tags found
No related merge requests found
...@@ -480,6 +480,9 @@ ...@@ -480,6 +480,9 @@
"required": "Please enter the room count limit", "required": "Please enter the room count limit",
"min": "Allowed minimum is 0", "min": "Allowed minimum is 0",
"max": "Allowed maximum is 100" "max": "Allowed maximum is 100"
},
"type": {
"error": "You must specify a number"
} }
}, },
"room": { "room": {
......
...@@ -23,6 +23,7 @@ import { useCallback, useMemo } from 'react'; ...@@ -23,6 +23,7 @@ import { useCallback, useMemo } from 'react';
export function useEditRoleLimitFormValidation() { export function useEditRoleLimitFormValidation() {
return useMemo(() => (yup.object({ return useMemo(() => (yup.object({
value: yup.number().required('forms.validations.role.limit.required') value: yup.number().required('forms.validations.role.limit.required')
.typeError('forms.validations.role.type.error')
.min(0, 'forms.validations.role.limit.min') .min(0, 'forms.validations.role.limit.min')
.max(100, 'forms.validations.role.limit.max'), .max(100, 'forms.validations.role.limit.max'),
})), []); })), []);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment