exotic-emerald
exotic-emerald•3y ago

Nested

I am trying to add nested resources, List inside Show (for one-to-many) also have a create in list using drawerform, but drawer form is catching the context of show not the List
27 Replies
Omer
Omer•3y ago
Hey @bhk2988 , Sorry, I don't fully understand. Can you give some example?
ugly-tan
ugly-tan•3y ago
No description
ugly-tan
ugly-tan•3y ago
I am creating something like this DIstribution -> has many versions I wan to add version to that distribution directly from here But when I click on create
ugly-tan
ugly-tan•3y ago
No description
ugly-tan
ugly-tan•3y ago
It is showing Distribution and not version
Omer
Omer•3y ago
You can use "resource" and "action" properties of useDrawerForm and can access active distribution id from id property of useShow
Omer
Omer•3y ago
As in this example, you can add the distributionId to your form data by overrriding the onFinish property of useDrawerForm. https://refine.dev/docs/guides-and-concepts/upload/base64-upload/
Base64 Upload | refine
By encoding your files and images from your forms to Base64 you can change all files needed for the upload to Base64 format before the submit. This can be done via the onFinish property of the `` component that comes with Ant Design
Omer
Omer•3y ago
Also you can override Create component' resource, title, etc properties. https://refine.dev/docs/ui-frameworks/antd/components/basic-views/create/#resource
Create | refine
`` provides us a layout to display the page. It does not contain any logic but adds extra functionalities like action buttons and giving titles to the page.
ugly-tan
ugly-tan•3y ago
I have passed resource to create
No description
ugly-tan
ugly-tan•3y ago
But it still showing clone their I hv managed to remove it by setting tags property of page header to empty array but still this should be the default behavior?
Omer
Omer•3y ago
Uhmm looks like a bug. Could you create a issue?
ugly-tan
ugly-tan•3y ago
Sure Also can u tell how we can manage redirect ? as there is no page component for this
Omer
Omer•3y ago
You can use useNavigation hooks
Omer
Omer•3y ago
useNavigation | refine
refine uses routerProvider and comes with all redirects out of the box. It allows you to manage your routing operations in refine. Using this hook, you can manage all the routing operations of your application very easily.
ugly-tan
ugly-tan•3y ago
After form is submited API is hit and its redirected to "list" of the resource by default but what if I want to stop the redirection