In useCustom, useList and useSelect hooks (antd), how can I check if request was succesful?
In useCustom, useList and useSelect hooks, how can I check if request was succesful?
2 Replies
Hi @chachi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To check if a request was successful in the
useCustom
, useList
, and useSelect
hooks in refine (Ant Design), you can utilize the successNotification
property. This property allows you to customize the success notification that appears when the data is fetched successfully. Here are examples for each hook:
useCustom
Hook
The successNotification
property in the useCustom
hook can be used to check if the request was successful and to customize the success notification message.
useList
Hook
Similarly, the successNotification
property in the useList
hook can be used to check if the request was successful and to customize the success notification message.
useSelect
Hook
The successNotification
property in the useSelect
hook can also be used to check if the request was successful and to customize the success notification message.
Important Note
For the successNotification
property to work, you need to have the NotificationProvider
(https://refine.dev/docs/notification/notification-provider/) set up in your application.
For more details, you can refer to the following documentation:
- useCustom
Hook (https://refine.dev/docs/data/hooks/use-custom/#successnotification)
- useList
Hook (https://refine.dev/docs/data/hooks/use-list/#successnotification)
- useSelect
Hook (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-select/#successnotification)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@95552725294518272> kapa.ai is still learning and improving, please let us know how it did by reacting below