Skip to content

Commit

Permalink
JSON needs to be converted to string
Browse files Browse the repository at this point in the history
  • Loading branch information
Vismayak committed Jan 21, 2025
1 parent fb19170 commit 7fc9988
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/components/navigation/FileSystemSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const FileSystemSelector: React.FC<{
showOnlyDatasetFiles: boolean;
selectFolder: boolean;
datasetId: string | undefined;
onChange: (SelectionDetails: SelectionDetails) => void;
onChange: (SelectionDetails: string) => void;
}> = ({ showOnlyDatasetFiles, selectFolder, datasetId, onChange }) => {
const [open, setOpen] = useState(false);
const [selection, setSelection] = useState<SelectionDetails>({
Expand Down Expand Up @@ -350,12 +350,15 @@ const FileSystemSelector: React.FC<{
const handleConfirmSelection = () => {
if (highlightedSelection.selectionID) {
setSelection(highlightedSelection);
onChange({
const selection = {
selectionID: highlightedSelection.selectionID,
selectionName: highlightedSelection.selectionName,
datasetId: highlightedSelection.datasetId,
selectionType: highlightedSelection.selectionType,
});
}
// Convert to string
const selectionString = JSON.stringify(selection);
onChange(selectionString);
handleClose();
}
};
Expand Down

0 comments on commit 7fc9988

Please sign in to comment.