diff --git a/docroot/modules/custom/va_gov_content_release/src/Controller/FrontendVersionAutocompleteController.php b/docroot/modules/custom/va_gov_content_release/src/Controller/FrontendVersionAutocompleteController.php index dee748c71c..a0398b8f13 100644 --- a/docroot/modules/custom/va_gov_content_release/src/Controller/FrontendVersionAutocompleteController.php +++ b/docroot/modules/custom/va_gov_content_release/src/Controller/FrontendVersionAutocompleteController.php @@ -69,12 +69,12 @@ public function handleAutocomplete(Request $request, string $frontend, int $coun $frontend = Frontend::from($frontend); } catch (\InvalidArgumentException $e) { - return JsonResponse::create(['error' => 'Invalid frontend type provided.']); + return new JsonResponse(['error' => 'Invalid frontend type provided.']); } $input = $request->query->get('q') ?? 'main'; $query = mb_strtolower($input); $results = $this->frontendVersionSearch->getMatchingReferences($frontend, $query, $count); - return JsonResponse::create($results); + return new JsonResponse($results); } }