Fixed creating new test
This commit is contained in:
parent
93170d0935
commit
2be6d216d1
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user