Finishing the test/edit route
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
This commit is contained in:
@@ -141,7 +141,11 @@ func TestPostEdit(c flamego.Context, form forms.TestForm, errs binding.Errors) {
|
||||
|
||||
// removed associated benchmarks that weren't in the form
|
||||
for _, b := range test.Benchmarks {
|
||||
|
||||
if ! form.IsBenchmarkSelected(b.ID) {
|
||||
var benchmark models.Benchmark
|
||||
models.DB.First(&benchmark, b) // find benchmark
|
||||
models.DB.Model(&test).Association("Benchmarks").Delete(&benchmark)
|
||||
}
|
||||
}
|
||||
|
||||
c.Redirect(fmt.Sprintf("/test/%d", test.ID))
|
||||
|
Reference in New Issue
Block a user