Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export type {
AutoTextInputProps,
} from "./auto/shared/AutoInputTypes.js";
export type { AutoRichTextInputProps } from "./auto/shared/AutoRichTextInputProps.js";
export { useActionMetadata, useModelMetadata } from "./metadata.js";
export * from "./useAction.js";
export * from "./useActionForm.js";
export * from "./useBulkAction.js";
Expand Down
4 changes: 1 addition & 3 deletions packages/react/src/metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ const treeifyModelMetadata = <T extends { key: string; fields: FieldMetadata[];

/**
* Retrieve a given Gadget model's metadata from the backend
* @internal
*/
export const useModelMetadata = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if the publicly exposed one should take a model manager so you can do

const {metadata} = useModelMetadata(api.todo)

apiIdentifier: string,
Expand Down Expand Up @@ -393,8 +392,7 @@ const getGlobalActionApiIdentifier = (api: AnyClient, fn: GlobalActionFunction<a
};

/**
* Retrieve a given Gadget model action's metadata from the backend
* @internal
* Retrieve a given Gadget action's metadata from the backend
*/
export const useActionMetadata = (
actionFunction: ActionFunction<any, any, any, any, any> | GlobalActionFunction<any>
Expand Down