A
Alokai16mo ago
Sky

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
skirianov
skirianov16mo ago
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
Sky
SkyOP16mo ago
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?
No description
rohrig
rohrig16mo ago
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.
Want results from more Discord servers?
Add your server