【发布时间】:2019-01-24 17:11:29
【问题描述】:
我试图创建一个应用程序进行管理,但在我的应用程序的循环中,我必须使用一个进程来创建会话。
在那里,我创建了一个本地化,但之后,我需要在该位置创建一个会话。
为此,我需要在发布请求 (api/localisations/{localisation_id}/sessions) 中传递本地化的 id,但我不知道该怎么做。
当我创建一个会话时,我有这个:
AddLocalisations (localisations) {
axios.request({
method: 'post',
url: 'http://127.0.0.1:8000/api/localisations/',
data: localisations,
}).catch(err => console.log(err))
}
onSubmit (event) {
const newLocalisations = {
name: this.refs.name.value,
address: this.refs.address.value,
phone: this.refs.phone.value,
}
this.AddLocalisations(newLocalisations)
event.preventDefault(
this.props.history.push('/AddSessions'),
)
}
【问题讨论】: