redirect to newly created table

This commit is contained in:
shams mosowi
2019-09-24 12:20:22 +10:00
parent b75e14e92b
commit 0b84d48472
2 changed files with 4 additions and 2 deletions

View File

@@ -50,7 +50,7 @@
- Delete tables
- Edit tables
- Hide tables
- On new table add, refresh view to the table view
- On new table add, refresh view to the table view
## V1

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react";
import AddIcon from "@material-ui/icons/Add";
import _camelCase from "lodash/camelCase";
import useRouter from "../hooks/useRouter";
import {
Button,
TextField,
@@ -15,6 +15,7 @@ import {
// TODO: Create an interface for props
export default function CreateTableDialog(props: any) {
const router = useRouter();
const { classes, createTable } = props;
const [open, setOpen] = React.useState(false);
const [tableName, setTableName] = useState("");
@@ -33,6 +34,7 @@ export default function CreateTableDialog(props: any) {
}
function handleCreate() {
createTable(tableName, collectionName);
router.history.push(collectionName);
handleClose();
}