racers table fix

This commit is contained in:
Martin Quarda 2024-10-10 09:29:47 +02:00
parent eaf3c49fe0
commit c3476a4a5f
2 changed files with 5 additions and 2 deletions

View File

@ -166,6 +166,7 @@ def login_status(request):
"last_name": user.profile.last_name,
"address": user.profile.address,
"racers": [{
"invoice_id": racer.invoice_id,
"first_name": racer.first_name,
"last_name": racer.last_name,
"email": racer.email,

View File

@ -209,17 +209,19 @@ class Main extends Component {
<th scope="col">Team</th>
<th scope="col">Datum narození</th>
<th scope="col">Zaplatil</th>
<th scope="col">Změnit</th>
</tr>
</thead>
<tbody>
{this.state.login_status.racers.map(racer =>
{(this.state.login_status.racers || []).map(racer =>
<tr>
<td>{racer.first_name}</td>
<td>{racer.last_name}</td>
<td>{racer.email}</td>
<td>{racer.team}</td>
<td>{racer.date_of_birth}</td>
<td>{racer.paid}</td>
<td>{racer.paid?"Zaplatil":"Nezaplatil"}</td>
<td><button onClick={(e) => {console.log(změnit)}}>Změnit</button></td>
</tr>)}
</tbody>