Skip to content

Commit 33c1fff

Browse files
author
jan hof
committed
fixed api lazy loading
1 parent 87d7f2c commit 33c1fff

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/hooks/configHook.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ import { useEffect, useState } from "react";
55
const useConfig = (namespace: string) => {
66
const [config, setConfig] = useState<JSONSchema6>();
77

8-
useEffect(() => {
9-
Axios.get("/api/webinterface/service/" + namespace).then((res) =>
10-
setConfig(res.data)
11-
);
12-
}, []);
8+
Axios.get("/api/webinterface/service/" + namespace).then((res) =>
9+
setConfig(res.data)
10+
);
1311

1412
return [config, setConfig];
1513
};

src/views/service/ServiceDetails.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ type ServiceDetailsProps = {
99
namespace: string;
1010
};
1111

12-
const schema: JSONSchema6 = {
13-
title: "Todo",
14-
type: "object",
15-
required: ["title"],
16-
properties: {
17-
title: { type: "string", title: "Title", default: "A new task" },
18-
done: { type: "boolean", title: "Done?", default: false },
19-
},
20-
};
21-
2212
const ServiceDetails = (props: RouteComponentProps<ServiceDetailsProps>) => {
2313
const [config, setConfig] = useConfig(props.match.params.namespace);
2414

0 commit comments

Comments
 (0)