diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 58ba4c80..30e5eb6b 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -432,7 +432,8 @@ "MAX_LENGTH_DIGITS_ERROR": "Maximum {{maxLength}} Digits allowed", "MIN_LENGTH_CHARACTERS_ERROR": "Minimum {{minLength}} characters required", "MAX_LENGTH_CHARACTERS_ERROR": "Maximum {{maxLength}} characters allowed", - "NUMBER_AND_SPECIAL_CHARACTERS_NOT_ALLOWED": "Numbers and special characters are not allowed" + "NUMBER_AND_SPECIAL_CHARACTERS_NOT_ALLOWED": "Numbers and special characters are not allowed", + "ENTER_VALID_MOBILE_NUMBER": "Enter Valid mobile number" }, "COURSE_PLANNER": { "COURSE_PLANNER": "Course Plan", diff --git a/src/components/AddLeanerModal.tsx b/src/components/AddLeanerModal.tsx index f660d649..00b43fdb 100644 --- a/src/components/AddLeanerModal.tsx +++ b/src/components/AddLeanerModal.tsx @@ -95,7 +95,8 @@ const AddLearnerModal: React.FC = ({ let cohortId, teacherData; if (typeof window !== 'undefined' && window.localStorage) { teacherData = JSON.parse(localStorage.getItem('teacherApp') || ''); - localStorage.getItem('cohortId') ?? localStorage.getItem('classId'); + cohortId = + localStorage.getItem('cohortId') ?? localStorage.getItem('classId'); } const { username, password } = generateUsernameAndPassword( teacherData?.state?.stateCode, @@ -161,7 +162,7 @@ const AddLearnerModal: React.FC = ({ } try { - if (isEditModal && userId) { + if (isEditModal && userId && cohortId) { console.log('apiBody', apiBody); const userData = { name: apiBody.name, diff --git a/src/components/DynamicForm.tsx b/src/components/DynamicForm.tsx index c0472488..5398d3eb 100644 --- a/src/components/DynamicForm.tsx +++ b/src/components/DynamicForm.tsx @@ -84,7 +84,7 @@ const DynamicForm: React.FC = ({ const property = error.property.substring(1); switch (pattern) { - case '^[^ ][a-zA-Z ]*[^ ]$': { + case '^[a-zA-Z][a-zA-Z ]*[a-zA-Z]$': { error.message = t( 'FORM_ERROR_MESSAGES.NUMBER_AND_SPECIAL_CHARACTERS_NOT_ALLOWED' ); diff --git a/src/pages/centers/[cohortId].tsx b/src/pages/centers/[cohortId].tsx index f2e3e340..0f1625e3 100644 --- a/src/pages/centers/[cohortId].tsx +++ b/src/pages/centers/[cohortId].tsx @@ -116,8 +116,9 @@ const TeachingCenterDetails = () => { setOpenSchedule(false); setDeleteModal(false); }; - const setRemoveCohortId = reassignLearnerStore((state) => state.setRemoveCohortId); - + const setRemoveCohortId = reassignLearnerStore( + (state) => state.setRemoveCohortId + ); useEffect(() => { const getCohortData = async () => { @@ -128,8 +129,8 @@ const TeachingCenterDetails = () => { if (response?.cohortData?.length) { cohortData = response?.cohortData[0]; - setRemoveCohortId(cohortData?.cohortId) - + setRemoveCohortId(cohortData?.cohortId); + if (cohortData?.customField?.length) { const district = cohortData.customField.find( (item: CustomField) => item.label === 'District' @@ -535,7 +536,7 @@ const TeachingCenterDetails = () => { {value === 3 && ( <> - + */} - { @@ -562,10 +563,10 @@ const TeachingCenterDetails = () => { }} > {t('COMMON.REVIEW_ATTENDANCE')} - - */} + {/* + /> */}