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 receipt6 Replies
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:
----------------------
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?
<@1085258022416285727> kapa.ai is still learning and improving, please let us how it did by reacting below
robust-apricot•2y 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
adverse-sapphire•2y 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/#mutationoptionsuseCreate | refine
useCreate is an extended version of TanStack Query's useMutation. It supports all the features of useMutation and adds some extra features.
fascinating-indigo•2y ago
Thanks, I will try it