Skip to content

Commit 9769c22

Browse files
committed
fix: fix sdf viewer from giving 404 error when submitting config
1 parent 3d35345 commit 9769c22

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/components/ViewFilePopover/SDFViewerListItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const SDFViewerListItem = ({ fileName, path, onClick }: SDFViewerListItem
1515
const router = useRouter();
1616

1717
const breadcrumbs = useProjectBreadcrumbs();
18-
path === undefined && (path = breadcrumbs.join("/"));
18+
if (path === undefined) {
19+
path = breadcrumbs.join("/");
20+
}
1921

2022
return (
2123
<A

src/features/SDFViewer/ConfigEditor.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
7878
// const onSubmit: SubmitHandler<SDFViewerConfig> = (data) => console.log(data);
7979

8080
return (
81-
<form onSubmit={() => void handleSubmit(onSubmit)}>
81+
<form onSubmit={(event) => void handleSubmit(onSubmit, (errors) => console.log(errors))(event)}>
8282
<Box sx={{ display: "grid", gap: 1, gridTemplateColumns: "1fr repeat(6, min-content)" }}>
8383
<Typography component="h3" variant="h4">
8484
Field name
@@ -119,7 +119,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
119119
</MenuItem>
120120
))}
121121
</TextField>
122-
123122
<Controller
124123
control={control}
125124
defaultValue={config[key].include}
@@ -144,7 +143,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
144143
/>
145144
)}
146145
/>
147-
148146
<TextField
149147
defaultValue={config[key].min}
150148
disabled={!getIsNumeric(key)}
@@ -165,7 +163,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
165163
sx={{ width: "7em" }}
166164
type="number"
167165
/>
168-
169166
<TextField
170167
disabled
171168
select

0 commit comments

Comments
 (0)