Skip to content

Commit

Permalink
Merge pull request #75 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
Issue #0000 chore: API call issue fixed
  • Loading branch information
itsvick authored Aug 1, 2024
2 parents c4c827b + 9792dc0 commit 2dd0b38
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/components/AddLeanerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
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,
Expand Down Expand Up @@ -161,7 +162,7 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
}

try {
if (isEditModal && userId) {
if (isEditModal && userId && cohortId) {
console.log('apiBody', apiBody);
const userData = {
name: apiBody.name,
Expand Down
2 changes: 1 addition & 1 deletion src/components/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const DynamicForm: React.FC<DynamicFormProps> = ({
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'
);
Expand Down
21 changes: 11 additions & 10 deletions src/pages/centers/[cohortId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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'
Expand Down Expand Up @@ -535,7 +536,7 @@ const TeachingCenterDetails = () => {
{value === 3 && (
<>
<Box mt={3} px={'18px'}>
<Button
{/* <Button
sx={{
border: '1px solid #1E1B16',
borderRadius: '100px',
Expand All @@ -547,25 +548,25 @@ const TeachingCenterDetails = () => {
endIcon={<AddIcon />}
>
{t('COMMON.ADD_NEW')}
</Button>
</Button> */}
</Box>
<Box
px={'18px'}
mt={2}
sx={{ display: 'flex', gap: '4px', alignItems: 'center' }}
>
<Box
{/* <Box
sx={{ color: theme.palette.secondary.main }}
className="fs-14 fw-500"
onClick={() => {
router.push('/attendance-overview');
}}
>
{t('COMMON.REVIEW_ATTENDANCE')}
</Box>
<ArrowForwardIcon
</Box> */}
{/* <ArrowForwardIcon
sx={{ fontSize: '18px', color: theme.palette.secondary.main }}
/>
/> */}
</Box>
<Box>
<CohortFacilitatorList
Expand Down

0 comments on commit 2dd0b38

Please sign in to comment.