public function __construct( private readonly AbstractExtensionDataProvider
$extensionDataProvider,
private readonly EntityRepository
$userRepository,
private readonly EntityRepository
$languageRepository ) { } #[Route(path: '/api/_action/extension/installed', name: 'api.extension.installed', methods: ['GET'])]
public function getInstalledExtensions(Context
$context): Response
{ $context =
$this->
switchContext($context);
return new JsonResponse( $this->extensionDataProvider->
getInstalledExtensions($context) );
} private function switchContext(Context
$context): Context
{ if (!
$context->
getSource() instanceof AdminApiSource
) { return $context;
}