Error accessing grand_total at orderGetters.ts
I have problem accessing grand_total at orderGetters.ts,
line 6: export const getGrandTotal = (order: CustomerOrder): number => order?.total?.grand_total?.value ?? 0;
This is the api query called in order page, there is no order.total.grand_total, there is only order.grand_total.
Please advice on this. Thank you.
3 Replies
there must've been a change in their API maybe. You can simply change the getter code to align it with the data structure that you're getting. Getters can be changed to suit your demand
I see this order.grand_total is deprecated, I should use order.total.grand_total instead. Is there a way to change their API so that it return order.total.grand_total?
If you have access and permission do so you could. But I think it would be easier to adjust the query according to the API.