Fixed typos in model searches

This commit is contained in:
Gregory Ballantine 2024-05-29 09:16:32 -04:00
parent ab6b94cb5f
commit 9ddf7fa928
4 changed files with 7 additions and 7 deletions

View File

@ -13,9 +13,9 @@
</tr>
</thead>
<tbody>
{{ range $h := .benchmarks }}
{{ range $b := .benchmarks }}
<tr>
<td><a href="/benchmark/{{ $h.ID }}">{{ $h.Name }}</a></td>
<td><a href="/benchmark/{{ $b.ID }}">{{ $b.Name }}</a></td>
<td>{{ $h.CreatedAt.Format "01/02/2006 15:04am" }}</td>
<td>{{ $h.UpdatedAt.Format "01/02/2006 15:04am" }}</td>
</tr>

View File

@ -17,7 +17,7 @@ import (
func BenchmarkGetList(t template.Template, data template.Data) {
// add benchmarks to template
var benchmarks []models.Benchmark
models.DB.First(&benchmarks)
models.DB.Find(&benchmarks)
data["benchmarks"] = benchmarks
data["title"] = "List of Benchmarks"
@ -30,7 +30,7 @@ func BenchmarkGetView(c flamego.Context, t template.Template, data template.Data
// find benchmark from DB
var benchmark models.Benchmark
models.DB.Find(&benchmark, benchmarkID)
models.DB.First(&benchmark, benchmarkID)
data["benchmark"] = benchmark
data["title"] = benchmark.Name

View File

@ -17,7 +17,7 @@ import (
func HardwareGetList(t template.Template, data template.Data) {
// add hardwares to template
var hardware []models.Hardware
models.DB.First(&hardware)
models.DB.Find(&hardware)
data["hardware"] = hardware
data["title"] = "List of Hardware"
@ -30,7 +30,7 @@ func HardwareGetView(c flamego.Context, t template.Template, data template.Data)
// find hardware from DB
var hardware models.Hardware
models.DB.Find(&hardware, hardwareID)
models.DB.First(&hardware, hardwareID)
data["hardware"] = hardware
data["title"] = hardware.Name

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.Find(&test, testID)
models.DB.First(&test, testID)
data["test"] = test
data["title"] = test.Name