diff --git a/client/src/components/analytics/AnalyticsDashboard.tsx b/client/src/components/analytics/AnalyticsDashboard.tsx index 255774a..5cb3c6d 100644 --- a/client/src/components/analytics/AnalyticsDashboard.tsx +++ b/client/src/components/analytics/AnalyticsDashboard.tsx @@ -16,7 +16,7 @@ export function AnalyticsDashboard() { const { toast } = useToast(); // Fetch Pages - const { data: pages = [], isLoading: isLoadingPages } = useQuery({ + const { data: pages = [], isLoading: isLoadingPages } = useQuery({ queryKey: ['/api/pages'], }); @@ -28,7 +28,7 @@ export function AnalyticsDashboard() { }, [pages, selectedPageId]); // Fetch History for selected page - const { data: history = [], isLoading: isLoadingHistory } = useQuery({ + const { data: history = [], isLoading: isLoadingHistory } = useQuery({ queryKey: [`/api/analytics/pages/${selectedPageId}/history`], enabled: !!selectedPageId, }); diff --git a/server/cron.ts b/server/cron.ts index 0426706..9f17f0c 100644 --- a/server/cron.ts +++ b/server/cron.ts @@ -1,5 +1,5 @@ import cron from 'node-cron'; -import { TokenManager } from '../services/token_manager'; +import { TokenManager } from './services/token_manager'; export function startTokenCron() { // Run every day at midnight (00:00) diff --git a/server/routes/analytics.ts b/server/routes/analytics.ts index 9d441d3..d2e029c 100644 --- a/server/routes/analytics.ts +++ b/server/routes/analytics.ts @@ -1,5 +1,5 @@ import { Router } from 'express'; -import { db } from '../index'; +import { db } from '../db'; import { AnalyticsService } from '../services/analytics'; import { TokenManager } from '../services/token_manager'; import { postAnalytics, pageAnalyticsHistory, socialPages } from '../../shared/schema'; diff --git a/server/services/analytics.ts b/server/services/analytics.ts index db5579b..78d003b 100644 --- a/server/services/analytics.ts +++ b/server/services/analytics.ts @@ -1,4 +1,4 @@ -import { db } from '../index'; +import { db } from '../db'; import { posts, scheduledPosts, diff --git a/server/services/token_manager.ts b/server/services/token_manager.ts index fb30fba..e7e5f89 100644 --- a/server/services/token_manager.ts +++ b/server/services/token_manager.ts @@ -1,5 +1,5 @@ import crypto from 'crypto'; -import { db } from '../index'; +import { db } from '../db'; import { socialPages, tokenStatusEnum } from '../../shared/schema'; import { eq, and, lte } from 'drizzle-orm'; import { GraphAPIClient } from '../utils/graph_client';