[FEATURE] Autonav after edit
This commit is contained in:
parent
9f0689f6a4
commit
e660465a59
1 changed files with 2 additions and 3 deletions
|
@ -35,6 +35,7 @@ export default function EditCoreOptions(props) {
|
|||
const { serverId } = props;
|
||||
const [spec, setSpec] = useState();
|
||||
const modifyServer = useModifyServer(spec);
|
||||
const nav = useNavigate();
|
||||
const { isLoading, data: serverBlueprint } = useGetServer(serverId);
|
||||
|
||||
useEffect(() => setSpec(serverBlueprint), [serverBlueprint]);
|
||||
|
@ -47,9 +48,7 @@ export default function EditCoreOptions(props) {
|
|||
|
||||
const coreUpdate = (attr) => (e) => updateSpec(attr, e.target.value);
|
||||
|
||||
const upsertSpec = () => {
|
||||
modifyServer(spec);
|
||||
};
|
||||
const upsertSpec = () => modifyServer().then(() => nav("/"));
|
||||
|
||||
const toggleBackupEnabled = () =>
|
||||
updateSpec("backupEnabled", !spec.backupEnabled);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue