When fetching property data via params, the ID's of agents are included in the response. However, I am encountering an issue where manually refreshing the page does not fetch the agent data, but navigating to the page through the app does.
What could be causing this discrepancy? Do I need to adjust how I structure my data fetching process?
async fetchData() {
try {
const property = await this.$axios.$get(
`/api/get-specific-property/${this.$route.params.id}`
)
if (property.success) {
this.property = property.data
const agentIDs = property.data.agents
this.fetchAgents(agentIDs)
}
} catch (err) {
console.log(err)
}
},
methods: {
async fetchAgents(agentIDs) {
try {
const agents = await this.$axios.$post('/api/get-specific-agents', agentIDs)
if(agents.success) {
this.agents = agents.data
}
} catch(err) {
console.log(err)
}
}
}