How can I get the resource id that I just created?

As the picture, I want to update receiptId in debit_notes after I create a new receipt But I don't know how to get receiptId right after I create a new receipt
No description
K
kapa.ai381d ago
Hi @j7.dev. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
K
kapa.ai381d ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the refine documentation for more information on handling data and actions: https://refine.dev/docs ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Overview | refine
What is refine?
K
kapa.ai381d ago
<@1085258022416285727> kapa.ai is still learning and improving, please let us how it did by reacting below
O
other-emerald381d ago
@j7.dev Though i am unsure how the bot exactly works, i think asking it like this might be better! "How can I update the receiptid value in the debit_notes resource with the receiptId value obtained after creating a new receipt?" I believe you would need to have it be async and then have an new and old receiptID or something similar though... but i don't know too much
S
sunny-green381d ago
Hey @j7.dev I think you can do this in onSuccess. You can view the details here. https://refine.dev/docs/api-reference/core/hooks/data/useCreate/#mutationoptions
useCreate | refine
useCreate is an extended version of TanStack Query's useMutation. It supports all the features of useMutation and adds some extra features.
C
correct-apricot380d ago
Thanks, I will try it
More Posts
useDataGrid and crudFiltersI am using useDataGrid, and I want to implement the crudFilters in my app, the same way as the fineFGo to a specific step when using antd's useStepsFormWhen using antd's useStepsForm in the edit page of a resource, is it possible to go to a specific stTyping the `custom` method in DataProviderHello, I am trying to type the response data from my `custom` method in the DataProvider, which usesClearing up usage/purpose of `custom` method parameters.Hey. For the `custom` method in a data provider, what is the difference between query, payload, andHelp 2 find Medusa dashboard or UI Panel (Refine Store Example)Hi, I just installed the Store Example (https://github.com/refinedev/refine/tree/master/examples/stoHow to use List CRUD component after swizzle?I am attempting to customize the interface of a Refine-Material UI app. I used the swizzle command tDeployment to Vercel 404 not found when pasting URLMaybe one of you ran into the same issue i am clueless on this one. I deployed my refine project forCreate Page - Autoselect Autocomplete based on id on parameterHi, i want to make my create page automatically selects the value on the dropdown autocomplete basednested table inside show pageI want to display table that shows list of relations using nested API. I want to do similar to the pCustomized Layouthi. I'm trying to create a react template with strapi v4 and ant design, while creating the project,AntdInferencer not working even adjusting the new APIreturn <AntdInferencer resource="blogs" action="list" />;how to pass additional "meta" for resources to dataProvider?I'm writing a new dataProfider for the WordPress REST API. I need to pass additional parameters for cliis there a shortcut syntax for cli i wanted to create a project that has the answer for the cli promHello everyone I just found this projectHello everyone I just found this project on twitter. And I want to understand the working logic. As