repod/lib/Controller/SearchController.php
Michel Roux bebd6bf5ed
All checks were successful
repod / xml (push) Successful in 13s
repod / php (push) Successful in 34s
repod / nodejs (push) Successful in 1m55s
repod / release (push) Has been skipped
fix: 🔒 app should not require admin access (closes #76)
2024-03-16 17:42:28 +01:00

30 lines
602 B
PHP

<?php
declare(strict_types=1);
namespace OCA\RePod\Controller;
use OCA\RePod\AppInfo\Application;
use OCA\RePod\Service\MultiPodService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
class SearchController extends Controller
{
public function __construct(
IRequest $request,
private MultiPodService $multiPodService
) {
parent::__construct(Application::APP_ID, $request);
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index(string $q): JSONResponse {
return new JSONResponse($this->multiPodService->search($q));
}
}