From 89e40d9d4d8b346b8ff5819d295fb34a3365ea35 Mon Sep 17 00:00:00 2001 From: Daniel Bachler Date: Tue, 5 Mar 2024 14:28:46 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9D=20eslint=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminSiteServer/testPageRouter.tsx | 1 - baker/algolia/indexExplorersToAlgolia.ts | 1 - db/model/Chart.ts | 4 ++-- db/tests/basic.test.ts | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/adminSiteServer/testPageRouter.tsx b/adminSiteServer/testPageRouter.tsx index 0ac32b2e193..4f9626c2c75 100644 --- a/adminSiteServer/testPageRouter.tsx +++ b/adminSiteServer/testPageRouter.tsx @@ -5,7 +5,6 @@ import React from "react" import { renderToHtmlPage, expectInt } from "../serverUtils/serverUtil.js" import { - Chart, getChartConfigBySlug, getChartVariableData, } from "../db/model/Chart.js" diff --git a/baker/algolia/indexExplorersToAlgolia.ts b/baker/algolia/indexExplorersToAlgolia.ts index dc99cc16113..14f6770c0ec 100644 --- a/baker/algolia/indexExplorersToAlgolia.ts +++ b/baker/algolia/indexExplorersToAlgolia.ts @@ -14,7 +14,6 @@ import { ALGOLIA_INDEXING } from "../../settings/serverSettings.js" import { getAnalyticsPageviewsByUrlObj } from "../../db/model/Pageview.js" import { chunkParagraphs } from "../chunk.js" import { SearchIndexName } from "../../site/search/searchTypes.js" -import { Chart } from "../../db/model/Chart.js" type ExplorerBlockColumns = { type: "columns" diff --git a/db/model/Chart.ts b/db/model/Chart.ts index 9404674cc5b..985d6b6ab7e 100644 --- a/db/model/Chart.ts +++ b/db/model/Chart.ts @@ -124,14 +124,14 @@ export async function getEnrichedChartBySlug( knex: db.KnexReadonlyTransaction, slug: string ): Promise { - const chart = await db.knexRawFirst( + let chart = await db.knexRawFirst( knex, `SELECT * FROM charts WHERE config ->> '$.slug' = ?`, [slug] ) if (!chart) { - const chart = await db.knexRawFirst( + chart = await db.knexRawFirst( knex, `select c.* from chart_slug_redirects csr diff --git a/db/tests/basic.test.ts b/db/tests/basic.test.ts index 39e7d6d0614..29b208569df 100644 --- a/db/tests/basic.test.ts +++ b/db/tests/basic.test.ts @@ -79,7 +79,7 @@ test("timestamps are automatically created and updated", async () => { config: "{}", lastEditedAt: new Date(), lastEditedByUserId: 1, - isExplorable: 1, + is_indexable: 0, } await trx.table(ChartsTableName).insert(chart) const created = await knexRawFirst( @@ -95,7 +95,7 @@ test("timestamps are automatically created and updated", async () => { await trx .table(ChartsTableName) .where({ id: 1 }) - .update({ isExplorable: 0 }) + .update({ is_indexable: 1 }) const updated = await knexRawFirst( trx, "select * from charts where id = 1",