API de restaurante
This commit is contained in:
@@ -8,7 +8,6 @@ use App\Services\Auth0Service;
|
||||
use App\Services\PaginatorService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
@@ -24,7 +23,7 @@ class UsuariosController extends Controller {
|
||||
$paginate = app(PaginatorService::class)->paginate(
|
||||
perPage: $request->input('per_page', 15),
|
||||
page: $request->input('page', 1),
|
||||
count: Usuario::all()->count(),
|
||||
total: Usuario::all()->count(),
|
||||
route: 'users.all',
|
||||
);
|
||||
|
||||
@@ -67,7 +66,7 @@ class UsuariosController extends Controller {
|
||||
'restaurant' => 'required|exists:restaurantes,id',
|
||||
]);
|
||||
|
||||
$restaurant = Restaurante::find($request->input('restaurant'));
|
||||
$restaurant = Restaurante::findOrNull($request->input('restaurant'));
|
||||
|
||||
$cantManageUsersOrRestaurant = $this->cantManageUsersOrRestaurant($request->user, $restaurant);
|
||||
if ($cantManageUsersOrRestaurant) {
|
||||
@@ -214,7 +213,7 @@ class UsuariosController extends Controller {
|
||||
], 404);
|
||||
}
|
||||
|
||||
$restaurant = Restaurante::find($restaurant);
|
||||
$restaurant = Restaurante::findOrNull($restaurant);
|
||||
if (!$restaurant) {
|
||||
return response()->json([
|
||||
'error' => 'not_found',
|
||||
@@ -257,7 +256,7 @@ class UsuariosController extends Controller {
|
||||
], 404);
|
||||
}
|
||||
|
||||
$restaurant = Restaurante::find($restaurant);
|
||||
$restaurant = Restaurante::findOrNull($restaurant);
|
||||
if (!$restaurant) {
|
||||
return response()->json([
|
||||
'error' => 'not_found',
|
||||
|
||||
Reference in New Issue
Block a user