feature/grabar-factura #11

Merged
aldarien merged 14 commits from feature/grabar-factura into develop 2025-02-04 10:37:34 -03:00
6 changed files with 203 additions and 139 deletions
Showing only changes of commit 16100f622e - Show all commits

View File

@ -5,9 +5,9 @@ use Psr\Http\Message\ResponseInterface;
trait withJson
{
public function withJson(ResponseInterface $response, array|object $data = []): ResponseInterface
public function withJson(ResponseInterface $response, array|object $data = [], int $statusCode = 200): ResponseInterface
{
$response->getBody()->write(json_encode($data));
return $response->withHeader('Content-Type', 'application/json');
return $response->withStatus($statusCode)->withHeader('Content-Type', 'application/json');
}
}