From 2bf7fa142f33822f28f74582b308c87bad0373c6 Mon Sep 17 00:00:00 2001 From: Edoardo Ranghieri Date: Tue, 20 Aug 2024 22:58:30 +0200 Subject: [PATCH] fix(types): infer `MetadataSchema` in `SafeActionClient` --- packages/next-safe-action/src/safe-action-client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next-safe-action/src/safe-action-client.ts b/packages/next-safe-action/src/safe-action-client.ts index 22f0fc5c..3d7e9f83 100644 --- a/packages/next-safe-action/src/safe-action-client.ts +++ b/packages/next-safe-action/src/safe-action-client.ts @@ -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 : undefined, + MD = MetadataSchema extends Schema ? Infer : undefined, Ctx extends object = {}, SF extends (() => Promise) | undefined = undefined, // schema function S extends Schema | undefined = SF extends Function ? Awaited> : undefined, @@ -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.