optimistic-gold•2y ago
creating entry in multiple resources
I want to create entry in multiple resources
5 Replies
Hi @Deepanshu Bajaj. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To create entries in multiple resources using refine, you can utilize the
useCreateMany hook. This hook allows you to create multiple entries in a single resource at once. However, if you want to create entries in multiple resources, you will need to call the mutate function of useCreateMany for each resource separately.
Here is an example of how you can create entries in multiple resources:
In this example, we are using the useCreateMany hook to create entries in both the "posts" and "categories" resources. The mutate function is called separately for each resource with the appropriate parameters.
For more information on the useCreateMany hook, you can refer to the documentation (https://refine.dev/docs/audit-logs/audit-log-provider#usecreatemany).
If you have any further questions or need additional assistance, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@661831547690680321> kapa.ai is still learning and improving, please let us know how it did by reacting below
optimistic-goldOP•2y ago
@kapa.ai detailed exmaple
Let me check the knowledge base for you. One moment! :books:
----------------------
To create entries in multiple resources using refine, you can utilize the
useCreateMany hook. This hook allows you to create multiple entries in a single resource at once. However, if you want to create entries in multiple resources, you will need to call the mutate function of useCreateMany for each resource separately.
Here is a detailed example of how you can create entries in multiple resources:
In this example, we are using the useCreateMany hook to create entries in both the "posts" and "categories" resources. The mutate function is called separately for each resource with the appropriate parameters.
For more information on the useCreateMany hook, you can refer to the documentation (https://refine.dev/docs/data/hooks/use-create-many/).
If you have any further questions or need additional assistance, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@661831547690680321> kapa.ai is still learning and improving, please let us know how it did by reacting below