This commit is contained in:
Martin Quarda 2024-10-16 13:48:37 +02:00
parent 460e20ed0d
commit 0ab09928d3

View File

@ -51,10 +51,12 @@ class Main extends Component {
this.setState({login_status: json})
})
fetch(addr_prefix + "/api/cart/delivery").then(resp => resp.json()).then(json => {
this.setState({
cart: [...this.state.cart, {"name": "Doprava na " + json, "id": 2, "price": delivery_cost, "locked": true, "quantity": 1}],
delivery: json,
})
if (json){
this.setState({
cart: [...this.state.cart, {"name": "Doprava na " + json, "id": 2, "price": delivery_cost, "locked": true, "quantity": 1}],
delivery: json,
})
}
})
if(window.location.search){
let searchParams = new URLSearchParams(window.location.search);