Skip to content

Commit

Permalink
🐛 fix query pointing to charts.config (#3960)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Sep 17, 2024
1 parent 815118d commit d5a1eed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions baker/algolia/indexExplorerViewsToAlgolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d5a1eed

Please sign in to comment.