From 12ec5d28b1b786ea6907d6240799a8455cb78905 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sun, 28 Jun 2026 13:37:32 -0500 Subject: [PATCH] feat: flow editor shows endpoint selector when api_report is chosen - Pass ENDPOINTS to JS context from company_endpoints table - Add api_report and goodbye options to flow function select - When api_report selected: show endpoint dropdown + date period + filename + caption fields - saveFlow() persists params.endpoint_key, date_mode, caption, filename - flowFuncToggle() shows/hides the endpoint panel on function change Co-Authored-By: Claude Sonnet 4.6 --- admin/DashboardController.php | 60 +++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) 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;