diff --git a/src/DataTable/TemplateTable.tsx b/src/DataTable/TemplateTable.tsx index 11c28ed..a7d490c 100644 --- a/src/DataTable/TemplateTable.tsx +++ b/src/DataTable/TemplateTable.tsx @@ -14,6 +14,11 @@ import { useSetIsShosen } from "../store/store"; import { ontLookup } from "./CategoryLookUp"; const columns = [ + { + accessorKey: "uuid", + header: "UUID", + cell: (props) => <>{props.getValue()}>, + }, { accessorKey: "template_name", header: "Template Name", @@ -75,6 +80,11 @@ export default function TemplateTable({ data }) { globalFilter: filtering, rowSelection, }, + initialState: { + columnVisibility: { + uuid: false, + }, + }, }); const setIdShosen = useSetIsShosen(); @@ -110,6 +120,7 @@ export default function TemplateTable({ data }) { ))} + {/* {console.log(table.getRowModel().rows[0]?.original?.uuid)} */} {table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => (
diff --git a/src/SurveyComp/SurveyComp.jsx b/src/SurveyComp/SurveyComp.jsx index f8b48ac..2332e8d 100644 --- a/src/SurveyComp/SurveyComp.jsx +++ b/src/SurveyComp/SurveyComp.jsx @@ -17,6 +17,8 @@ import { useIntermediateData, } from "../store/store"; +import { useLocation } from "react-router-dom"; + import config from "../utils/config"; import "survey-core/defaultV2.min.css"; @@ -36,7 +38,11 @@ function SurveyComponent({ setResult }) { const idShosen = useIsShosen(); const setIntermediateData = useSetIntermediateData(); - const id = idShosen ? idShosen : UUID; + const location = useLocation(); + const queryParams = new URLSearchParams(location.search); + const uuidParams = queryParams.get("uuid"); + + const id = idShosen ? idShosen : UUID || uuidParams; // eslint-disable-next-line react-hooks/exhaustive-deps async function getTemplateInfo() { diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index e1c0c99..ebf479d 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -15,16 +15,10 @@ export default function HomePage() { const uuidParams = queryParams.get("uuid"); const wizardParams = queryParams.get("wizard"); - // if (uuidParams) { - // setUUID(uuidParams); - // } - - console.log("home", UUID); - return ( <> {wizardParams &&