0👍
✅
Figured it out.
The issue was with the asyncData function in the component.
The function was like so:
async asyncData({ $axios, params }) {
const { data } = await $axios.get(`/companies/${params.id}`)
return { company: data.data }
but I should have used the payload like so:
async asyncData({ $axios, payload, params }) {
if (payload) {
return { company: payload }
} else {
const { data } = await $axios.get(`/companies/${params.id}`)
return { company: data.data }
}
}
Source:stackexchange.com