FormaPago Service
This commit is contained in:
@ -13,7 +13,7 @@ class Login
|
||||
public function form(ServerRequestInterface $request, ResponseInterface $response, View $view, Service\Login $service): ResponseInterface
|
||||
{
|
||||
if ($service->isIn()) {
|
||||
return $response->withStatus(301)->withHeader('Location', $view->get('urls')->base);
|
||||
return $response->withStatus(302)->withHeader('Location', $view->get('urls')->base);
|
||||
}
|
||||
return $view->render($response, 'login.form');
|
||||
}
|
||||
|
@ -32,8 +32,13 @@ class Ventas
|
||||
public function show(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||
Service\Venta $service, int $venta_id): ResponseInterface
|
||||
{
|
||||
$venta = $service->getById($venta_id);
|
||||
return $view->render($response, 'ventas.show', compact('venta'));
|
||||
try {
|
||||
$venta = $service->getById($venta_id);
|
||||
return $view->render($response, 'ventas.show', compact('venta'));
|
||||
} catch (EmptyResult) {
|
||||
$response = $response->withStatus(404);
|
||||
return $view->render($response, 'not_found');
|
||||
}
|
||||
}
|
||||
public function showUnidad(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||
Service\Venta $service, string $proyecto_nombre, int $unidad_descripcion): ResponseInterface
|
||||
|
Reference in New Issue
Block a user