Middleware Schema #141
Replies: 2 comments 3 replies
-
Not sure if I fully understand the issue, but in the upcoming v7 you can pass a |
Beta Was this translation helpful? Give feedback.
-
Sorry if my explanations were not clear. Let me share with you an example code ;
With this being defined, I can create a customServerAction like this
Now If I call that customServerAction somewhere in my code, I would expect some typesafety if its argument are not containing { secret : "..." } because it is required by the middleware. I hope this makes it more understable :p |
Beta Was this translation helpful? Give feedback.
-
Hello,
First of all, thank you so much for the great library. It is extremely useful to me.
When I create a safe action with a middleware, is there a way to add a schema to that middleware ?
And ensure that it is typesafe ? Somehow if my middleware requires { dataId : string} and the function itself { newData : string} , when calling the safe actions, it should only accept { dataId : string ; newData : string} ?
Thank you so much :)
Beta Was this translation helpful? Give feedback.
All reactions