From 5ce148a875c48ff546d82563ed84a2558231aa40 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Fri, 13 Dec 2024 20:43:06 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20chart=20pageviews=20sql=20?= =?UTF-8?q?query=20bug=20to=20only=20match=20pageviews=20for=20published?= =?UTF-8?q?=20charts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteServer/apiRouter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminSiteServer/apiRouter.ts b/adminSiteServer/apiRouter.ts index 8a42da80c67..2d5035559eb 100644 --- a/adminSiteServer/apiRouter.ts +++ b/adminSiteServer/apiRouter.ts @@ -728,7 +728,7 @@ getRouteWithROTransaction(apiRouter, "/charts.json", async (req, res, trx) => { SELECT ${oldChartFieldList} FROM charts JOIN chart_configs ON chart_configs.id = charts.configId JOIN users lastEditedByUser ON lastEditedByUser.id = charts.lastEditedByUserId - LEFT JOIN analytics_pageviews on analytics_pageviews.url = CONCAT("https://ourworldindata.org/grapher/", chart_configs.slug) + LEFT JOIN analytics_pageviews on (analytics_pageviews.url = CONCAT("https://ourworldindata.org/grapher/", chart_configs.slug) AND chart_configs.full ->> '$.isPublished' = "true" ) LEFT JOIN users publishedByUser ON publishedByUser.id = charts.publishedByUserId ORDER BY charts.lastEditedAt DESC LIMIT ? `,