Fixed some things with the test add functions

This commit is contained in:
Gregory Ballantine
2024-06-03 09:43:33 -04:00
parent 6079524c4e
commit de8e523c2c
4 changed files with 5 additions and 5 deletions

View File

@ -49,13 +49,13 @@ class TestController extends Controller {
$test->description = $params['test_description'];
$test->component_id = $params['test_component'];
$test->save();
// attach benchmarks to test
foreach ($params['test_benchmarks'] as $b) {
$test->benchmarks()->attach($b);
}
$test->save();
// redirect the user back to the home page
$routeContext = RouteContext::fromRequest($request);
$routeParser = $routeContext->getRouteParser();

View File

@ -16,7 +16,7 @@ class Test extends Model {
return $this->hasMany(Result::class);
}
public function benchmark() {
public function benchmarks() {
return $this->belongsToMany(Benchmark::class);
}