Fixed creating new test

This commit is contained in:
Gregory Ballantine 2024-05-29 09:52:41 -04:00
parent 93170d0935
commit 2be6d216d1

View File

@ -72,5 +72,10 @@ func TestPostCreate(c flamego.Context, form forms.TestForm, errs binding.Errors)
_ = models.DB.Create(&test)
for _, v := range form.Benchmarks {
fmt.Printf("%s", v)
test.Association("Benchmarks").Append(models.Benchmark{ID: v})
}
c.Redirect(fmt.Sprintf("/test/%d", test.ID))
}