Fixed results table in test view

This commit is contained in:
Gregory Ballantine 2024-05-29 11:57:49 -04:00
parent 3eca29c2db
commit 29d9cbc59c
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@
<tbody>
{{ range $res := .test.Results }}
<tr>
<td>{{ $res.Hardware.Name }}</td>
<td>{{ .test.Hardware.Name }}</td>
<td>{{ $res.Benchmark.Name }}</td>
<td>{{ $res.AverageScore }}</td>
<td>{{ $res.MinimumScore }}</td>

View File

@ -30,7 +30,7 @@ func TestGetView(c flamego.Context, t template.Template, data template.Data) {
// find hardware from DB
var test models.Test
models.DB.Preload("Hardware").Preload("Benchmarks").Preload("Results").First(&test, testID)
models.DB.Preload("Hardware").Preload("Benchmarks").Preload("Results.Benchmark").First(&test, testID)
data["test"] = test
data["title"] = test.Name