我第二次寻求帮助。我正在使用反应平台制作汉堡应用程序并将数据保存在 firebase 数据库中(实时)。当我存储数据时,价格、地址、客户信息保存在 firebase 数据库中,但成分变量没有保存在数据库中。如何解决这个问题呢?
orderHandler = (event) => {
event.preventDefault();
this.setState({Loading: true});
console.log(this.props.ingrediants);
const order = {
Ingrediants : this.props.ingrediants,
Price : this.props.price,
customers : {
Name: 'Zulfiqar Hussain Anjum',
address: {
street: '4',
zipcode: '46000',
Country: 'Pakistan',
},
email: 'raeesanjum010@gmail.com'
},
deliveryMethod: 'fastest',
}
axios.post('/orders.json', order)
.then(response=> {
this.setState({Loading: false});
this.props.history.push('/');
})
.catch(error=> {
this.setState({Loading: false});
});
}
firebase数据库和数据库数据的链接是:
baseURL : "https://burger-react-app-2faba.firebaseio.com/"
orders
-M2iPiluSayuzFdsfFNk
Price: "6.500000000000001"
customers
deliveryMethod: "fastest"