Continued work on the test/edit post routet
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Gregory Ballantine
2025-08-12 11:40:56 -04:00
parent 60d8554cf1
commit 4b98322022
2 changed files with 31 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
package models
import (
"fmt"
"strconv"
"gorm.io/gorm"
@@ -30,3 +31,20 @@ func (t *Test) SelectedBenchmarks() []string {
}
return ids
}
func (t *Test) IsBenchmarkSelected(benchmarkID string) bool {
benchmarkConv, err := strconv.ParseUint(benchmarkID, 10, 0)
if err != nil {
fmt.Println("Error parsing Uint: ", err)
}
benchmarkUint := uint(benchmarkConv)
for _, b := range t.Benchmarks {
if b.ID == benchmarkUint {
return true
}
}
return false
}