RePod-Nextcloud-App/lib/Controller/SearchController.php

26 lines
551 B
PHP
Raw Normal View History

2023-07-26 01:26:46 +02:00
<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
2024-01-18 11:43:58 +01:00
use OCA\RePod\Service\MultiPodService;
2023-07-26 01:26:46 +02:00
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
class SearchController extends Controller
{
public function __construct(
IRequest $request,
2024-01-18 11:43:58 +01:00
private MultiPodService $multiPodService
2023-07-26 01:26:46 +02:00
) {
parent::__construct(Application::APP_ID, $request);
}
public function index(string $q): JSONResponse {
return new JSONResponse($this->multiPodService->search($q));
2023-07-26 01:26:46 +02:00
}
}