Skip to content

Commit

Permalink
🐝 eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Mar 15, 2024
1 parent 0f7356e commit 89e40d9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion adminSiteServer/testPageRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React from "react"

import { renderToHtmlPage, expectInt } from "../serverUtils/serverUtil.js"
import {
Chart,
getChartConfigBySlug,
getChartVariableData,
} from "../db/model/Chart.js"
Expand Down
1 change: 0 additions & 1 deletion baker/algolia/indexExplorersToAlgolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions db/model/Chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ export async function getEnrichedChartBySlug(
knex: db.KnexReadonlyTransaction,
slug: string
): Promise<DbEnrichedChart | null> {
const chart = await db.knexRawFirst<DbRawChart>(
let chart = await db.knexRawFirst<DbRawChart>(
knex,
`SELECT * FROM charts WHERE config ->> '$.slug' = ?`,
[slug]
)

if (!chart) {
const chart = await db.knexRawFirst<DbRawChart>(
chart = await db.knexRawFirst<DbRawChart>(
knex,
`select c.*
from chart_slug_redirects csr
Expand Down
4 changes: 2 additions & 2 deletions db/tests/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DbRawChart>(
Expand All @@ -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<DbRawChart>(
trx,
"select * from charts where id = 1",
Expand Down

0 comments on commit 89e40d9

Please sign in to comment.