Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type SmartActionLoadHook does not support async function #804

Open
felipe-augusto opened this issue Aug 31, 2021 · 0 comments
Open

Type SmartActionLoadHook does not support async function #804

felipe-augusto opened this issue Aug 31, 2021 · 0 comments
Assignees

Comments

@felipe-augusto
Copy link
Contributor

Expected behavior

The type should support an async function based on the docs described here: https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions/use-a-smart-action-form#prefill-a-form-with-default-values

export interface SmartActionHooks {
  load: SmartActionLoadHook;
  change: Record<string, SmartActionChangeHook>;
}

export interface SmartActionLoadHook {
  (context: { fields: SmartActionLoadHookField[], request: SmartActionLoadHookRequest })
  : SmartActionLoadHookField[] | Promise<SmartActionLoadHookField[]>
}

Actual behavior

export interface SmartActionLoadHook {
  (context: { fields: SmartActionLoadHookField[], request: SmartActionLoadHookRequest }): SmartActionLoadHookField[] 
}

Context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants