Skip to content

Commit

Permalink
fix(types): infer MetadataSchema in SafeActionClient
Browse files Browse the repository at this point in the history
  • Loading branch information
TheEdoRan committed Aug 20, 2024
1 parent 214e648 commit 2bf7fa1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/next-safe-action/src/safe-action-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class SafeActionClient<
ServerError,
ODVES extends DVES | undefined, // override default validation errors shape
MetadataSchema extends Schema | undefined = undefined,
MD = MetadataSchema extends Schema ? Infer<Schema> : undefined,
MD = MetadataSchema extends Schema ? Infer<MetadataSchema> : undefined,
Ctx extends object = {},
SF extends (() => Promise<Schema>) | undefined = undefined, // schema function
S extends Schema | undefined = SF extends Function ? Awaited<ReturnType<SF>> : undefined,
Expand Down Expand Up @@ -233,7 +233,7 @@ export class SafeActionClient<
}

/**
* Define the stateful action (without input validation schema, bind arguments validation schemas or metadata).
* Define the stateful action.
* To be used with the [`useStateAction`](https://next-safe-action.dev/docs/execution/hooks/usestateaction) hook.
* @param serverCodeFn Code that will be executed on the **server side**
* @param [cb] Optional callbacks that will be called after action execution, on the server.
Expand Down

0 comments on commit 2bf7fa1

Please sign in to comment.