edit

hi all I face issue on updating an item in DB I want to edit on item by opening a new page spaceficly for edit like this
{
name: "Products",
list: Products,
show: ProductDetails,
create: CreateProduct,
edit: EditProduct,
icon: <Build/>,
},
{
name: "Products",
list: Products,
show: ProductDetails,
create: CreateProduct,
edit: EditProduct,
icon: <Build/>,
},
how I can get the item details in the edit page ? which hook I should use ?
4 Replies
genetic-orange
genetic-orange2y ago
Depends on your UI, you can use different components. See the example for Ant Design https://refine.dev/docs/api-reference/antd/components/basic-views/edit/ Feel free to check our documentation based on your needs
Edit | refine
`` provides us a layout for displaying the page. It does not contain any logic but adds extra functionalities like a refresh button.
genetic-orange
genetic-orange2y ago
@batuhanw I know that can use useUpdate() hook or the same way you send above but I tried its did not work, and I don't have enough explanations about which sections that will provide me the item details
genetic-orange
genetic-orange2y ago
Hello @Deleted User , I think you can use useForm hook https://refine.dev/docs/api-reference/core/hooks/useForm/
useForm | refine
useForm is a hook that allows to manage forms. It has some action methods that create, edit and clone the form. The hook return value comes to according to the called action and it can run different logic depending on the action.
genetic-orange
genetic-orange2y ago
yes I used it with register and its put the value of the item automatically thank you