diff --git a/admin/DashboardController.php b/admin/DashboardController.php
index fdda3ad..f2fb370 100644
--- a/admin/DashboardController.php
+++ b/admin/DashboardController.php
@@ -2294,6 +2294,7 @@ HTML;
$msg = $_GET['msg'] ?? '';
$toastHtml = $msg === 'saved' ? '
Configuración guardada exitosamente.
' : '';
+ $companyEndpoints = [];
if ($companyId > 0) {
$company = CompanyRepository::findById($companyId);
if ($company) {
@@ -2302,6 +2303,9 @@ HTML;
$parsed = json_decode($cj, true);
if (is_array($parsed)) $config = $parsed;
}
+ $epStmt = db()->prepare('SELECT endpoint_key, url, method FROM company_endpoints WHERE company_id=? AND is_active=1 ORDER BY endpoint_key');
+ $epStmt->execute([$companyId]);
+ $companyEndpoints = $epStmt->fetchAll(PDO::FETCH_ASSOC);
}
}
@@ -3010,7 +3014,8 @@ HTML;
echo '';
// ─── Inline JS for interactivity ─────────────────────────────────
- $configJson = json_encode($config, JSON_UNESCAPED_UNICODE);
+ $configJson = json_encode($config, JSON_UNESCAPED_UNICODE);
+ $endpointsJson = json_encode(array_column($companyEndpoints, null, 'endpoint_key'), JSON_UNESCAPED_UNICODE);
echo <<
@@ -3021,6 +3026,7 @@ HTML;