From c15d083f98cf179ccd39e5f9aa6f9fca9f0c3222 Mon Sep 17 00:00:00 2001 From: Ellen Kraffmiller Date: Sun, 3 Nov 2024 20:46:15 -0500 Subject: [PATCH] fix: cast collectionId from useParams to string --- src/sections/create-dataset/CreateDatasetFactory.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sections/create-dataset/CreateDatasetFactory.tsx b/src/sections/create-dataset/CreateDatasetFactory.tsx index a1fec5ae1..d20823149 100644 --- a/src/sections/create-dataset/CreateDatasetFactory.tsx +++ b/src/sections/create-dataset/CreateDatasetFactory.tsx @@ -21,10 +21,8 @@ export class CreateDatasetFactory { } function CreateDatasetWithSearchParams() { - const { collectionId } = useParams<{ collectionId: string }>() - if (!collectionId) { - throw new Error('collectionId is required') - } + const { collectionId } = useParams<{ collectionId: string }>() as { collectionId: string } + return (