ITADN

Union zod type consoling issues

#235Closedmvrcelitos 创建于 2025-02-12
M
mvrcelitoscommented
I have tried some methods and ways to make an input optional, so i can pass or not. I had created a schema for my server action like this: ```javascript z.union([ z.object({ ... }), z.void(), ]).optional() ``` And when i doesn't pass a object, the function works normally but debugs on console an issue, and the same happens when i pass a object. In other words, regardless of what I pass, because it is a `z.union`, the function will pass the input and work normally, but, the issues in my schemas will be debugged in the console. ![Image](https://github.com/user-attachments/assets/e2d85e4d-a739-4724-b902-ec65eec6a029)
关闭于 2025-02-20 0 条评论