Skip to content

Commit

Permalink
🐝 remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
danyx23 committed Dec 19, 2023
1 parent 08036af commit 3c26036
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion adminSiteClient/DatasetEditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ interface DatasetPageData {
tags: { id: number; name: string }[]
variables: VariableListItem[]
charts: ChartListItem[]
source?: OwidSource
variableSources: OwidSource[]
zipFile?: { filename: string }

Expand Down
8 changes: 0 additions & 8 deletions adminSiteServer/apiRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1879,8 +1879,6 @@ apiRouter.get("/datasets/:datasetId.json", async (req: Request) => {

dataset.origins = origins

// This is only for backwards compatibility where we showed only the first source per
// dataset. We now show all of them, so perhaps this part could be removed.
const sources = await db.queryMysql(
`
SELECT s.id, s.name, s.description
Expand All @@ -1891,12 +1889,6 @@ apiRouter.get("/datasets/:datasetId.json", async (req: Request) => {
[datasetId]
)

if (sources.length > 0) {
dataset.source = JSON.parse(sources[0].description)
dataset.source.id = sources[0].id
dataset.source.name = sources[0].name
}

// expand description of sources and add to dataset as variableSources
dataset.variableSources = sources.map((s: any) => {
return {
Expand Down

0 comments on commit 3c26036

Please sign in to comment.