Skip to content

Commit 9ee915a

Browse files
authored
Merge pull request #743 from mahajanmahesh935/Bugfixes
TASK #00000 : Show TVET name on youth profile
2 parents 9e43752 + ffb11df commit 9ee915a

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/pages/centers/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ const CentersPage = () => {
202202
});
203203

204204
setBlockData(blockData);
205+
localStorage.setItem('tvetName', blockData[0].blockName);
205206
}
206207

207208
if (

src/pages/learner/[userId].tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from '@/utils/app.constant';
2424
import { logEvent } from '@/utils/googleAnalytics';
2525
import {
26+
capitalizeFirstLetterOfEachWordInArray,
2627
extractAddress,
2728
formatSelectedDate,
2829
getUserDetailsById,
@@ -541,6 +542,24 @@ const LearnerProfile: React.FC<any> = () => {
541542
};
542543
});
543544

545+
const updatedLearnerDetails = learnerDetailsByOrder.flatMap((field) => {
546+
const tvetName = localStorage.getItem('tvetName');
547+
548+
if (field.label === 'TVETS_ENROLLMENT_NUMBER') {
549+
return [
550+
{
551+
key: 'TVET_NAME',
552+
label: 'TVET Name',
553+
displayValue: tvetName
554+
? capitalizeFirstLetterOfEachWordInArray(tvetName ? [tvetName] : [])
555+
: '-',
556+
},
557+
field,
558+
];
559+
}
560+
return field;
561+
});
562+
544563
//------ Test Report API Integration------
545564

546565
// const handleChangeTest = (event: SelectChangeEvent) => {
@@ -1069,7 +1088,7 @@ const LearnerProfile: React.FC<any> = () => {
10691088
padding="15px"
10701089
>
10711090
<Grid container spacing={4}>
1072-
{learnerDetailsByOrder?.map(
1091+
{updatedLearnerDetails?.map(
10731092
(
10741093
item: {
10751094
label?: string;

0 commit comments

Comments
 (0)