Javascript 一些数据没有';无法在firebase数据库上保存
我第二次请求帮助。我正在使用react平台制作burger应用程序,并将数据保存在firebase数据库中(实时)。当我存储数据时,价格、地址、客户信息保存在firebase数据库中,但配料变量没有保存在数据库中。如何解决这个问题Javascript 一些数据没有';无法在firebase数据库上保存,javascript,reactjs,firebase-realtime-database,backend,react-fullstack,Javascript,Reactjs,Firebase Realtime Database,Backend,React Fullstack,我第二次请求帮助。我正在使用react平台制作burger应用程序,并将数据保存在firebase数据库中(实时)。当我存储数据时,价格、地址、客户信息保存在firebase数据库中,但配料变量没有保存在数据库中。如何解决这个问题 orderHandler = (event) => { event.preventDefault(); this.setState({Loading: true}); console.log(this
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"
this.props.ingrediants
这将是json值,对吗?代码似乎很好,硬代码this.props.ingrediants
值,然后发送请求。this.props.ingrediants
此值未保存,其余值将保存在数据库中我还创建了相同的应用程序,对我来说,它被正确地保存在数据库中。this.props.ingrediants
这将是json值,对吗?代码似乎很好,硬编码this.props.ingrediants
值,然后发送请求。this.props.ingrediants
此值未保存,其余值将保存在数据库中我还创建了相同的应用程序,对我来说,它已正确保存在数据库中。