mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-15 20:17:22 +00:00
fix enum field causing issues when created in modal + changed data empty button text/target
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { serveStatic } from "@hono/node-server/serve-static";
|
||||
import type { BkndConfig } from "bknd";
|
||||
import { App } from "../../App";
|
||||
import type { BkndConfig } from "../index";
|
||||
|
||||
async function getHtml() {
|
||||
return readFile("index.html", "utf8");
|
||||
|
||||
@@ -179,6 +179,7 @@ export function objectDepth(object: object): number {
|
||||
}
|
||||
|
||||
export function objectCleanEmpty<Obj extends { [key: string]: any }>(obj: Obj): Obj {
|
||||
if (!obj) return obj;
|
||||
return Object.entries(obj).reduce((acc, [key, value]) => {
|
||||
if (value && Array.isArray(value) && value.some((v) => typeof v === "object")) {
|
||||
const nested = value.map(objectCleanEmpty);
|
||||
|
||||
@@ -121,7 +121,8 @@ export function DataEmpty() {
|
||||
const [navigate] = useNavigate();
|
||||
|
||||
function handleButtonClick() {
|
||||
navigate(routes.settings.path(["data", "entities"]), { absolute: true });
|
||||
//navigate(routes.settings.path(["data", "entities"]), { absolute: true });
|
||||
navigate(routes.data.schema.root());
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -129,7 +130,7 @@ export function DataEmpty() {
|
||||
Icon={IconDatabase}
|
||||
title="No entity selected"
|
||||
description="Please select an entity from the left sidebar or create a new one to continue."
|
||||
buttonText="Create Entity"
|
||||
buttonText="Go to schema"
|
||||
buttonOnClick={handleButtonClick}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ registries.media.add("local", {
|
||||
|
||||
const connection = new LibsqlConnection(
|
||||
createClient({
|
||||
url: "file:.db/show.db"
|
||||
url: "file:.db/new.db"
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user