From ac1aec3b41e360dc4d134a563682081cdd3ea54b Mon Sep 17 00:00:00 2001 From: Carter Rollins Date: Tue, 15 Oct 2024 15:21:35 -0400 Subject: [PATCH] Fixes TS errors --- frontend/app/(dashboard)/data/features/[featureId]/page.tsx | 4 ++-- .../app/(dashboard)/data/taxonomies/[taxonomy]/page.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/app/(dashboard)/data/features/[featureId]/page.tsx b/frontend/app/(dashboard)/data/features/[featureId]/page.tsx index c575e37..f7dcf1c 100644 --- a/frontend/app/(dashboard)/data/features/[featureId]/page.tsx +++ b/frontend/app/(dashboard)/data/features/[featureId]/page.tsx @@ -11,7 +11,7 @@ export default async function FeatureId({ params }: { params: { featureId: strin const headers = lines[0].split("\t"); for (let i = 1; i < lines.length; i++) { - const obj = {}; + const obj = {} as { featureid: String, species: String }; const currentline = lines[i].split("\t"); for (let j = 0; j < headers.length; j++) { @@ -21,7 +21,7 @@ export default async function FeatureId({ params }: { params: { featureId: strin result.push(obj); } - const feature = result.find((f) => f.featureid === params.featureId); + const feature = result.find((f) => f.featureid === params.featureId) as { featureid: String, species: String }; //const records = parse(content, { bom: true, columns: true }); //console.log(records) diff --git a/frontend/app/(dashboard)/data/taxonomies/[taxonomy]/page.tsx b/frontend/app/(dashboard)/data/taxonomies/[taxonomy]/page.tsx index b356bb0..a1df6c6 100644 --- a/frontend/app/(dashboard)/data/taxonomies/[taxonomy]/page.tsx +++ b/frontend/app/(dashboard)/data/taxonomies/[taxonomy]/page.tsx @@ -11,7 +11,7 @@ export default async function FeatureId({ params }: { params: { taxonomy: string const headers = lines[0].split("\t"); for (let i = 1; i < lines.length; i++) { - const obj = {}; + const obj = {} as { featureid: String, species: String }; const currentline = lines[i].split("\t"); for (let j = 0; j < headers.length; j++) { @@ -31,8 +31,8 @@ export default async function FeatureId({ params }: { params: { taxonomy: string {/*

{features[0]}

*/}

Features:

- {features.map((f) => ( - + {features.map((f, i) => ( +
{f.featureid}