I have this structure folder:
components/
character.vue
pages/
teams/
_id.vue
In the _id.vue file I have a mounted function to get the team with a specific ID:
data () {
return{
id: this.$route.params.id,
team: [],
}
},
mounted () {
axios.get(`https://example.com/admin/wp-json/wp/v2/teams/${this.id}`)
.then(response => {
this.team = response.data
}),
}
Here in this stage I have the team object.
What I want to do is to bring one more object who has related with team object in this page and carry to character component.
I want to call this URL https://example.com/admin/wp-json/wp/v2/character/{character_id} and get the specific character object who belong to the team.
The character ID is in the team.acf.acf_choose_character.
I believe that what I am asking for has been understood.
Thanks in advance!
Below is the team object:
"acf": {
"acf_choose_character": [
11
],
"acf_choose pathways": [
159,
166,
167
],
"acf_team_final_score": ""
},