Skip to content

Commit f4af2df

Browse files
authored
Merge pull request #2661 from Rushikesh-Sonawane99/release-1.15.0
Issue #PS-6347 fix: Fixed Issue Center list - unable to search center
2 parents 2b45a6d + 210acc9 commit f4af2df

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

apps/admin-app-repo/src/pages/centers.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
} from '@/services/CohortService/cohortService';
3333
import ConfirmationPopup from '@/components/ConfirmationPopup';
3434
import { updateCohort } from '@/services/MasterDataService';
35-
import { transformLabel } from '@/utils/Helper';
35+
import { transformLabel, transformLabelWithoutSpaces } from '@/utils/Helper';
3636
import { useTheme } from '@mui/material/styles';
3737
import AddIcon from '@mui/icons-material/Add';
3838
import CenteredLoader from '@/components/CenteredLoader/CenteredLoader';
@@ -279,7 +279,7 @@ const Centers = () => {
279279
{
280280
key: 'name',
281281
label: 'Center Name',
282-
render: (row: any) => transformLabel(row?.name),
282+
render: (row: any) => transformLabelWithoutSpaces(row?.name),
283283
},
284284
{
285285
key: 'address',

apps/admin-app-repo/src/utils/Helper.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ export const transformLabel = (label: string): string => {
139139
.replace(/\b\w/g, (char) => char.toUpperCase()); // Capitalize the first letter of each word
140140
};
141141

142+
export const transformLabelWithoutSpaces = (label: string): string => {
143+
if (typeof label !== 'string') {
144+
return label as any;
145+
}
146+
147+
return label
148+
.toLowerCase()
149+
.replace(/\b\w/g, (char) => char.toUpperCase());
150+
};
151+
152+
142153
export const transformArray = (arr: State[]): State[] => {
143154
if (!arr || !Array.isArray(arr)) {
144155
return arr;

0 commit comments

Comments
 (0)