add test batches
This commit is contained in:
@@ -18,7 +18,7 @@ class DashboardController extends BaseApiController
|
||||
public function route(): JsonResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
if (! $user) {
|
||||
if (!$user) {
|
||||
return $this->error('Unauthorized.', Response::HTTP_UNAUTHORIZED);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,13 @@ class DashboardRedirectController extends Controller
|
||||
public function __construct(
|
||||
private DashboardRouteService $service,
|
||||
private ApplicationUrlService $urls,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function dashboard(): RedirectResponse
|
||||
{
|
||||
$user = auth()->user();
|
||||
if (! $user) {
|
||||
if (!$user) {
|
||||
return redirect()->guest($this->urls->webLoginUrl());
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class DatabaseHealthController extends BaseApiController
|
||||
public function index(): JsonResponse
|
||||
{
|
||||
$result = $this->healthService->check();
|
||||
if (! $result['ok']) {
|
||||
if (!$result['ok']) {
|
||||
return $this->error('Database connection failed.', Response::HTTP_SERVICE_UNAVAILABLE, [
|
||||
'error' => $result['error'],
|
||||
]);
|
||||
|
||||
@@ -8,8 +8,8 @@ use App\Http\Requests\System\NavItemStoreRequest;
|
||||
use App\Http\Resources\System\NavBuilderDataResource;
|
||||
use App\Http\Resources\System\NavItemResource;
|
||||
use App\Models\NavItem;
|
||||
use App\Services\Navigation\NavbarService;
|
||||
use App\Services\Navigation\NavBuilderService;
|
||||
use App\Services\Navigation\NavbarService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -67,7 +67,7 @@ class NavBuilderController extends BaseApiController
|
||||
|
||||
$deleted = $this->builderService->delete($id);
|
||||
|
||||
if (! $deleted) {
|
||||
if (!$deleted) {
|
||||
return $this->error('Menu item not found.', Response::HTTP_NOT_FOUND);
|
||||
}
|
||||
|
||||
@@ -81,8 +81,7 @@ class NavBuilderController extends BaseApiController
|
||||
try {
|
||||
$this->builderService->reorder($request->validated()['orders']);
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Nav reorder failed: '.$e->getMessage());
|
||||
|
||||
Log::error('Nav reorder failed: ' . $e->getMessage());
|
||||
return $this->error('Unable to reorder items.', Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@ class StatsController extends BaseApiController
|
||||
{
|
||||
try {
|
||||
$stats = Stats::query()->get()->toArray();
|
||||
|
||||
return $this->success($stats, 'Statistics retrieved successfully');
|
||||
} catch (\Throwable $e) {
|
||||
Log::error('Stats retrieval error: '.$e->getMessage());
|
||||
|
||||
return $this->respondError('Failed to retrieve statistics', Response::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user