From 11d9bf8e4fc5ef5c0f9e317efc70697582cd940d Mon Sep 17 00:00:00 2001 From: 1sonhador <1sonhador@gmail.com> Date: Wed, 15 Oct 2025 13:39:13 +0100 Subject: [PATCH] fix: Add redirectsList JavaScript function to redirects index page - Add complete redirectsList() function with API integration - Include analytics_slug support in JavaScript - Fix missing function that was causing page to not load - Add proper error handling and loading states --- crm/Redirects/Views/redirects/index.php | 215 +++++++++++++++++- crm/check_analytics_slug.php | 11 + crm/{test_api.php => test_analytics_slug.php} | 4 +- 3 files changed, 227 insertions(+), 3 deletions(-) create mode 100644 crm/check_analytics_slug.php rename crm/{test_api.php => test_analytics_slug.php} (90%) diff --git a/crm/Redirects/Views/redirects/index.php b/crm/Redirects/Views/redirects/index.php index bbe37e2..17f6fdb 100644 --- a/crm/Redirects/Views/redirects/index.php +++ b/crm/Redirects/Views/redirects/index.php @@ -150,4 +150,217 @@ - \ No newline at end of file + + + \ No newline at end of file diff --git a/crm/check_analytics_slug.php b/crm/check_analytics_slug.php new file mode 100644 index 0000000..8aa3bcc --- /dev/null +++ b/crm/check_analytics_slug.php @@ -0,0 +1,11 @@ +fetchAll('SELECT id, cuid, analytics_slug, name FROM redirects WHERE status >= 0 LIMIT 5'); + +echo "πŸ” Verificando analytics_slug na base de dados...\n\n"; + +foreach ($redirects as $r) { + echo "ID: {$r['id']}, CUID: {$r['cuid']}, Analytics Slug: " . ($r['analytics_slug'] ?? 'NULL') . ", Name: {$r['name']}\n"; +} diff --git a/crm/test_api.php b/crm/test_analytics_slug.php similarity index 90% rename from crm/test_api.php rename to crm/test_analytics_slug.php index cc6ccfd..8eda102 100644 --- a/crm/test_api.php +++ b/crm/test_analytics_slug.php @@ -1,5 +1,4 @@ getAll(); - echo "πŸ” Testando API de redirects...\n\n"; + echo "πŸ” Testando analytics_slug...\n\n"; echo "πŸ“Š Total de redirects: " . count($redirects) . "\n\n"; if (!empty($redirects)) { @@ -24,6 +23,7 @@ try { foreach ($redirects as $redirect) { if (empty($redirect['analytics_slug'])) { $withoutSlug++; + echo "❌ Redirect ID {$redirect['id']} sem analytics_slug\n"; } }