axios-actions
axios-actions copied to clipboard
array.map requests causes error
Using construction of
const data = await Promise.all(
Object.values(this.orders).map(
async (order) =>
// await this.$axios.$get(`/authenticated/site/client/order/${order.id}`)
await this.$api.auth.use('data').getClientTicketByOrderId({
id: order.id
})
)
)
Causes error
TypeError: Cannot read property 'data' of null
at eval (axios-actions.esm.js?2d04:491)
at eval (axios-actions.esm.js?2d04:288)
at Array.forEach (<anonymous>)
at eval (axios-actions.esm.js?2d04:287)
Changing to normal axios request inside async function, works as expected
Hey, I'm finding it a bit hard to work on OS at the moment.
Is this a blocker for you?
For now, i just changed
await this.$api.auth.use('data').getClientTicketByOrderId({
id: order.id
})
to
await this.$axios.$get(`/authenticated/site/client/order/${order.id}`)
and it works ok, but it would be great if you could reproduce and fix it, because this approach causes me to move away endpoint from ApiGroup.