how to get :id
event/v1/event/:id/ticket-class/new/
how to get :id in the code, I want to create a ticket-class list but the :id cannot be obtained.
3 Replies
Hi @angga30prabu. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In refine, you can obtain the
id
from the current URL using the useParsed
hook. Here is an example of how you can do this:
In this example, id
will hold the value of :id
from the current URL.
If you want to use this id
in a form, you can pass it to the useForm
hook like this:
In this example, the useForm
hook is used with a resource named "custom-resource" and the id
obtained from the URL.
You can find more information about this in the refine documentation (https://refine.dev/docs/api-reference/antd/hooks/form/useForm/).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@550882194181193746> kapa.ai is still learning and improving, please let us know how it did by reacting below
exotic-emerald•14mo ago
hello @angga30prabu
bot code seems valid. is it worked ?