20 lines
430 B
PHP
20 lines
430 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$app = app();
|
|
$pdo = $app->pdo();
|
|
|
|
if (!$pdo) {
|
|
http_response_code(500);
|
|
echo json_encode(['error' => 'DB disabled or unavailable'], JSON_UNESCAPED_UNICODE);
|
|
exit;
|
|
}
|
|
|
|
$repo = new \App\Repository\MaterialMatrixRepository($pdo);
|
|
$printers = $repo->listActivePrinters();
|
|
|
|
echo json_encode($printers, JSON_UNESCAPED_UNICODE);
|
|
exit;
|