Skip to content

Commit

Permalink
🔨 post-rebase code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Jan 13, 2025
1 parent df340c9 commit 9af48d6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion adminSiteServer/mockSiteRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ async function getTombstoneAttachments(
}
}

getPlainRouteNonIdempotentWithRWTransaction(
getPlainRouteWithROTransaction(
mockSiteRouter,
"/deleted/:tombstoneSlug",
async (req, res, trx) => {
Expand Down
6 changes: 3 additions & 3 deletions db/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -812,20 +812,20 @@ export function getImageUsage(trx: KnexReadonlyTransaction): Promise<
export async function generateTopicTagGraph(
knex: KnexReadonlyTransaction
): Promise<TagGraphRoot> {
const { __rootId: rootId, ...parents } = await getFlatTagGraph(knex)
const { __rootId, ...parents } = await getFlatTagGraph(knex)

const tagGraphTopicsOnly = Object.entries(parents).reduce(
(acc: FlatTagGraph, [parentId, children]) => {
acc[Number(parentId)] = children.filter((child) => {
if (child.parentId === rootId) return true
if (child.parentId === __rootId) return true
return child.isTopic
})
return acc
},
{} as FlatTagGraph
)

return createTagGraph(tagGraphTopicsOnly, rootId)
return createTagGraph(tagGraphTopicsOnly, __rootId)
}

export const getUniqueTopicCount = (
Expand Down
3 changes: 1 addition & 2 deletions db/model/Post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ export const getFullPostByIdFromSnapshot = async (
return getFullPost(trx, postEnriched.wpApiSnapshot)
}

// kicking this can till WP posts kick the bucket
// COVID pages are the only WP pages left that are citable, grep "pageOverrides" to see more
// This function used to be more complicated, but now the only citable WP post is the COVID page
export const isPostSlugCitable = (slug: string): boolean => {
return slug === "coronavirus"
}
Expand Down
1 change: 1 addition & 0 deletions site/runSiteNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const runSiteNavigation = (
baseUrl: string,
hideDonationFlag?: boolean
) => {
// Used to determine whether or not to show the searchbar in the header
let isOnHomepage = false
if (window._OWID_GDOC_PROPS) {
const props = getOwidGdocFromJSON(window._OWID_GDOC_PROPS)
Expand Down

0 comments on commit 9af48d6

Please sign in to comment.