diff --git a/app/Http/Controllers/Dashboard/ObrasController.php b/app/Http/Controllers/Dashboard/ObrasController.php
new file mode 100644
index 0000000..38f34bc
--- /dev/null
+++ b/app/Http/Controllers/Dashboard/ObrasController.php
@@ -0,0 +1,29 @@
+only(['start', 'end', 'type']);
+ $query = array_merge(['type' => 'api'], $query);
+
+ try {
+ $response = Http::timeout(5)->get('https://obras-information.comalcalco.gob.mx/api/controller.php?action=getCounters', $query);
+
+ if (! $response->successful()) {
+ return response()->json(['error' => 'External service error'], $response->status());
+ }
+
+ return response()->json($response->json(), $response->status())
+ ->header('Content-Type', $response->header('Content-Type', 'application/json'));
+ } catch (\Throwable $e) {
+ Log::error('Proxy error: '.$e->getMessage());
+ return response()->json(['error' => 'Unable to contact external service'], 502);
+ }
+ }
+}
diff --git a/app/Http/Controllers/Dashboard/TramiteController.php b/app/Http/Controllers/Dashboard/TramiteController.php
new file mode 100644
index 0000000..12cccf2
--- /dev/null
+++ b/app/Http/Controllers/Dashboard/TramiteController.php
@@ -0,0 +1,29 @@
+only(['start', 'end', 'type']);
+ $query = array_merge(['type' => 'api'], $query);
+
+ try {
+ $response = Http::timeout(5)->get('https://tramites.comalcalco.gob.mx/reporte-especial', $query);
+
+ if (! $response->successful()) {
+ return response()->json(['error' => 'External service error'], $response->status());
+ }
+
+ return response()->json($response->json(), $response->status())
+ ->header('Content-Type', $response->header('Content-Type', 'application/json'));
+ } catch (\Throwable $e) {
+ Log::error('Proxy error: '.$e->getMessage());
+ return response()->json(['error' => 'Unable to contact external service'], 502);
+ }
+ }
+}
diff --git a/resources/js/Layouts/DashboardLayout.vue b/resources/js/Layouts/DashboardLayout.vue
index b26c1cb..cbacbaa 100644
--- a/resources/js/Layouts/DashboardLayout.vue
+++ b/resources/js/Layouts/DashboardLayout.vue
@@ -55,11 +55,6 @@ onMounted(()=> {
name="help.title"
to="dashboard.help"
/>
-
+
+
+const fetchReport = async ({ start, end }) => {
+ // cancelar petición previa
+ if (cancelTokenSource) {
+ try { cancelTokenSource.cancel('cancel'); } catch (e) {}
+ }
+ cancelTokenSource = axios.CancelToken.source();
+
+ const params = {};
+ if (start) params.start = start;
+ if (end) params.end = end;
+
+ const res = await axios.get('/api/reporte-especial', {
+ params,
+ cancelToken: cancelTokenSource.token,
+ headers: { 'X-Requested-With': 'XMLHttpRequest' }
+ });
+
+ // axios lanza en error si status >= 400, aquí devolvemos data directamente
+ return res.data;
+};
+
+
+
+
+ Hola
+
diff --git a/resources/js/Pages/Dashboard/Tramites.vue b/resources/js/Pages/Dashboard/Tramites.vue
index 7514808..fa27f74 100644
--- a/resources/js/Pages/Dashboard/Tramites.vue
+++ b/resources/js/Pages/Dashboard/Tramites.vue
@@ -1,6 +1,7 @@