Update hosts form
This commit is contained in:
@@ -13,6 +13,7 @@ import type { ImageInputToBase64FunctionReturn } from "../components/twui/utils/
|
||||
import EJSON from "../utils/ejson";
|
||||
import twuiSlugify from "../components/twui/utils/slugify";
|
||||
import _ from "lodash";
|
||||
import type { AppContextObject } from "../types";
|
||||
|
||||
type Params<T extends {} = BUN_SQLITE_WGUI_ALL_TYPEDEFS> = {
|
||||
/**
|
||||
@@ -46,6 +47,7 @@ type Params<T extends {} = BUN_SQLITE_WGUI_ALL_TYPEDEFS> = {
|
||||
before_ready_function?: (params: {
|
||||
form: T;
|
||||
setForm: Dispatch<SetStateAction<T>>;
|
||||
app_context: AppContextObject;
|
||||
}) => Promise<void>;
|
||||
};
|
||||
|
||||
@@ -111,7 +113,11 @@ export default function useFormInit<
|
||||
} finally {
|
||||
if (params?.before_ready_function) {
|
||||
params
|
||||
.before_ready_function({ form, setForm })
|
||||
.before_ready_function({
|
||||
form,
|
||||
setForm,
|
||||
app_context: appContext,
|
||||
})
|
||||
.then(() => {})
|
||||
.catch((e2) => {
|
||||
console.log(
|
||||
|
||||
Reference in New Issue
Block a user