Added API handler for getting a benchmark's tests

This commit is contained in:
Gregory Ballantine committed 2024-06-03 12:39:33 -04:00
1 parent 10df46be3b
commit 4a4f694831
2 files changed
+11

No files matched your search

+10
View File
@@ -19,4 +19,14 @@ class ApiController extends Controller {
->withHeader('Content-Type', 'application/json');
}
public function getBenchmarkTests(Request $request, Response $response, array $args): Response {
$benchmark = Benchmark::where('id', $args['benchmark_id'])->first();
$payload = json_encode($benchmark->tests);
$response->getBody()->write($payload);
return $response
->withHeader('Content-Type', 'application/json');
}
}