Cleanup logs, fixed add Venta, fixed search
This commit is contained in:
20
app/src/Controller/API/Search.php
Normal file
20
app/src/Controller/API/Search.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace Incoviba\Controller\API;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Incoviba\Service;
|
||||
|
||||
class Search
|
||||
{
|
||||
use withJson;
|
||||
|
||||
public function query(ServerRequestInterface $request, ResponseInterface $response,
|
||||
Service\Search $service): ResponseInterface
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
$results = $service->query($data['query'], $data['tipo']);
|
||||
$output = compact('results');
|
||||
return $this->withJson($response, $output);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user