embarrassing-maroonE
Refine3y ago
9 replies
embarrassing-maroon

How to submit different data when using useForm with Typescript?

I have an Edit/Create page for my resource and I use Typescript. I wrote code according to docs, but my submit form has to be different from what I get as fetched resource values. I created a separate type for submit form, but I can't fit it into existing code, I don't understand it. How do I submit a form which has a different type from resource type? I made it as "any" first, but it will be of type FeatureContent. So I need the type FeatureContentEditForm to submit, but I can't. I'll share code of types on comments

upd: the error at the bottom says "Argument of type T is not assignable to type B"
telegram-cloud-photo-size-2-5348509378162049228-y.jpg
Was this page helpful?