Skip to content

Commit 0c919c1

Browse files
committed
feaT: repeat regex logic in listedSubjects code
1 parent 8190f26 commit 0c919c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

apps/web/src/routes/_app/datahub/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import type { Subject } from '@opendatacapture/schemas/subject';
1515
import { removeSubjectIdScope } from '@opendatacapture/subject-utils';
1616
import { createFileRoute, useNavigate } from '@tanstack/react-router';
1717
import axios from 'axios';
18+
import { UserSearchIcon } from 'lucide-react';
1819
import { unparse } from 'papaparse';
1920

2021
import { IdentificationForm } from '@/components/IdentificationForm';
2122
import { PageHeader } from '@/components/PageHeader';
2223
import { subjectsQueryOptions, useSubjectsQuery } from '@/hooks/useSubjectsQuery';
2324
import { useAppStore } from '@/store';
2425
import { downloadExcel } from '@/utils/excel';
25-
import { UserSearchIcon } from 'lucide-react';
2626

2727
type MasterDataTableProps = {
2828
data: Subject[];
@@ -103,7 +103,7 @@ const RouteComponent = () => {
103103
getExportRecords()
104104
.then((data): any => {
105105
const listedSubjects = tableData.map((record) => {
106-
return record.id.replace('root$', '');
106+
return record.id.replace(/^.*?\$/, '');
107107
});
108108

109109
const filteredData = data.filter((dataEntry) => listedSubjects.includes(dataEntry.subjectId));

0 commit comments

Comments
 (0)