From d5a1eeda8ed7f45345fe1b0f77ba678984f6e4d2 Mon Sep 17 00:00:00 2001 From: Sophia Mersmann Date: Tue, 17 Sep 2024 09:45:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20query=20pointing=20to=20ch?= =?UTF-8?q?arts.config=20(#3960)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- baker/algolia/indexExplorerViewsToAlgolia.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/baker/algolia/indexExplorerViewsToAlgolia.ts b/baker/algolia/indexExplorerViewsToAlgolia.ts index 37e84e87d60..aa4f1aa2aa3 100644 --- a/baker/algolia/indexExplorerViewsToAlgolia.ts +++ b/baker/algolia/indexExplorerViewsToAlgolia.ts @@ -172,14 +172,15 @@ const getExplorerViewRecordsForExplorerSlug = async ( `Fetching grapher configs from ${grapherIds.length} graphers for explorer ${slug}` ) const grapherIdToTitle = await trx - .table("charts") .select( - "id", - trx.raw("config->>'$.title' as title"), - trx.raw("config->>'$.subtitle' as subtitle") + trx.raw("charts.id as id"), + trx.raw("chart_configs.full->>'$.title' as title"), + trx.raw("chart_configs.full->>'$.subtitle' as subtitle") ) - .whereIn("id", grapherIds) - .andWhereRaw("config->>'$.isPublished' = 'true'") + .from("charts") + .join("chart_configs", { "charts.configId": "chart_configs.id" }) + .whereIn("charts.id", grapherIds) + .andWhereRaw("chart_configs.full->>'$.isPublished' = 'true'") .then((rows) => keyBy(rows, "id")) for (const record of records) {