Within my code, I am utilizing the function
PanelService.getSetupOrder(route.params.id)
which provides me with 4 specific variables:
- data
- pending
- error
- refresh
While researching the documentation, it was mentioned that by specifying data: order
, I could store data in the 'order' variable.
Since I am using Typescript, I am curious about whether it is possible to assign the 'order' variable with a type of Ref<Order>.
I attempted to achieve this as follows:
const { data: order: Ref<Order>, pending, error, refresh } = await PanelService.getSetupOrder(route.params.id)
and const { data: (order: Ref<Order>), pending, error, refresh } = await PanelService.getSetupOrder(route.params.id)