This commit is contained in:
Martin Quarda 2024-10-13 09:49:28 +02:00
parent 8af3e6cfb7
commit bed195770e
2 changed files with 6 additions and 1 deletions

View File

@ -180,7 +180,7 @@ def login_status(request):
"last_name": user.profile.last_name, "last_name": user.profile.last_name,
"address": user.profile.address, "address": user.profile.address,
"racers": [{ "racers": [{
"invoice_id": racer.invoice.invoice_id, "invoice_id": racer.invoice_id,
"first_name": racer.first_name, "first_name": racer.first_name,
"last_name": racer.last_name, "last_name": racer.last_name,
"email": racer.email, "email": racer.email,
@ -331,6 +331,7 @@ def payment_state(request):
def products(request): def products(request):
return HttpResponse(json.dumps([ return HttpResponse(json.dumps([
{ {
'id': product.id,
'name': product.name, 'name': product.name,
'description': product.description, 'description': product.description,
'img': product.img.url, 'img': product.img.url,

View File

@ -25,6 +25,7 @@ class Main extends Component {
gallery_open: undefined, gallery_open: undefined,
page: window.location.hash, page: window.location.hash,
photos: [], photos: [],
products: [],
photoIsOpen: false, photoIsOpen: false,
progress: false, progress: false,
currentImage: 0, currentImage: 0,
@ -37,6 +38,9 @@ class Main extends Component {
fetch(addr_prefix + "/api/photos").then(resp => resp.json()).then(json => { fetch(addr_prefix + "/api/photos").then(resp => resp.json()).then(json => {
this.setState({photos: json}) this.setState({photos: json})
}) })
fetch(addr_prefix + "/api/products").then(resp => resp.json()).then(json => {
this.setState({products: json})
})
fetch(addr_prefix + "/api/login_status").then(resp => resp.json()).then(json => { fetch(addr_prefix + "/api/login_status").then(resp => resp.json()).then(json => {
this.setState({login_status: json}) this.setState({login_status: json})
}) })