diff --git a/.replit b/.replit index 1cda342..8826cfc 100644 --- a/.replit +++ b/.replit @@ -50,10 +50,6 @@ externalPort = 3000 localPort = 43777 externalPort = 4200 -[[ports]] -localPort = 45921 -externalPort = 6800 - [env] PORT = "5000" diff --git a/client/src/pages/Article.tsx b/client/src/pages/Article.tsx index 00887b8..7097447 100644 --- a/client/src/pages/Article.tsx +++ b/client/src/pages/Article.tsx @@ -19,15 +19,13 @@ export default function Article() { const { user } = useAuth(); const [betAmounts, setBetAmounts] = useState>({}); - const { data: article, isLoading: articleLoading } = useQuery
({ + const { data: articleData, isLoading: articleLoading } = useQuery
({ queryKey: ["/api/articles", params?.slug], enabled: !!params?.slug }); - const { data: outlet, isLoading: outletLoading } = useQuery({ - queryKey: ["/api/media-outlets", article?.mediaOutletId], - enabled: !!article?.mediaOutletId - }); + const article = articleData; + const outlet = articleData?.outlet; const { data: markets = [], isLoading: marketsLoading } = useQuery({ queryKey: ["/api/articles", params?.slug, "markets"], @@ -113,7 +111,7 @@ export default function Article() { return parts; }; - if (articleLoading || outletLoading) { + if (articleLoading) { return (
diff --git a/server/routes.ts b/server/routes.ts index 76c2a1c..a3c74f9 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -100,7 +100,9 @@ export async function registerRoutes(app: Express): Promise { if (!article) { return res.status(404).json({ message: "Article not found" }); } - res.json(article); + const allOutlets = await storage.getMediaOutlets(); + const outlet = allOutlets.find(o => o.id === article.mediaOutletId); + res.json({ ...article, outlet }); } catch (error) { console.error("Error fetching article:", error); res.status(500).json({ message: "Failed to fetch article" });