repod/lib/Controller/SearchController.php

30 lines
602 B
PHP
Raw Permalink Normal View History

2023-07-25 23:26:46 +00:00
<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
2024-01-18 10:43:58 +00:00
use OCA\RePod\Service\MultiPodService;
2023-07-25 23:26:46 +00: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 10:43:58 +00:00
private MultiPodService $multiPodService
2023-07-25 23:26:46 +00:00
) {
parent::__construct(Application::APP_ID, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(string $q): JSONResponse {
return new JSONResponse($this->multiPodService->search($q));
2023-07-25 23:26:46 +00:00
}
}