mirror of
https://github.com/rowyio/rowy.git
synced 2026-02-24 04:01:17 +01:00
allow table creation with _schema doc preset
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
TABLE_GROUP_SCHEMAS,
|
||||
TABLE_SCHEMAS,
|
||||
} from "@src/config/dbPaths";
|
||||
import { Controller } from "react-hook-form";
|
||||
|
||||
export enum TableSettingsDialogModes {
|
||||
create,
|
||||
@@ -203,6 +204,13 @@ export default function TableSettings({
|
||||
|
||||
return (
|
||||
<>
|
||||
<Controller
|
||||
control={formFieldsProps.control}
|
||||
name="_schema"
|
||||
defaultValue={{}}
|
||||
render={() => <></>}
|
||||
/>
|
||||
|
||||
<Stack
|
||||
direction="row"
|
||||
spacing={1}
|
||||
|
||||
@@ -78,10 +78,10 @@ export default function HomePage() {
|
||||
data: null,
|
||||
});
|
||||
|
||||
const handleCreateTable = () =>
|
||||
const handleCreateTable = (data?: null | (Table & { tableType: string })) =>
|
||||
setSettingsDialogState({
|
||||
mode: TableSettingsDialogModes.create,
|
||||
data: null,
|
||||
data: data || null,
|
||||
});
|
||||
|
||||
const [settingsDocState] = useDoc(
|
||||
@@ -107,7 +107,7 @@ export default function HomePage() {
|
||||
<Fab
|
||||
color="secondary"
|
||||
aria-label="Create table"
|
||||
onClick={handleCreateTable}
|
||||
onClick={() => handleCreateTable()}
|
||||
sx={{
|
||||
zIndex: "speedDial",
|
||||
position: "fixed",
|
||||
|
||||
Reference in New Issue
Block a user