I am trying to send the varaible to the url of axios but doing so it provide me the error 404 and even '{' braces are changed to '%' on error
import Axios from 'axios' export default {
mounted(){
this.$parent.$on('create_new_lesson',(seriesId)=>{
this.seriesId = seriesId
$('#createLesson').modal()
})
},
data()
{
return{
title:'',
description:'',
episode_number:'',
video_id:'',
seriesId:''
}
},
methods:{
createLesson()
{
Axios.post('/admin/${this.seriesId}/lessons',{
title:this.title,
description:this.description,
episode_number:this.episode_number,
video_id:this.video_id
}).then(resp =>{
console.log(resp)
}). catch(resp =>{
console.log(resp)
})
}
}
}
it should return send the created data to the consoleenter image description here
'/admin/'+this.seriesId+'/lessons'
– Boussadjra Brahim