Fix bug CSRF token!

This commit is contained in:
Reckless_Satoshi
2022-01-04 16:23:52 -08:00
parent 9ade961e0f
commit 369d9e52a7

View File

@ -73,7 +73,7 @@ export default class OrderPage extends Component {
console.log(this.state) console.log(this.state)
const requestOptions = { const requestOptions = {
method: 'POST', method: 'POST',
headers: {'Content-Type':'application/json', 'X-CSRFToken': csrftoken}, headers: {'Content-Type':'application/json', 'X-CSRFToken': getCookie('csrftoken')},
body: JSON.stringify({}), body: JSON.stringify({}),
}; };
fetch('/api/order/' + '?order_id=' + this.orderId, requestOptions) fetch('/api/order/' + '?order_id=' + this.orderId, requestOptions)