Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/server/controllers/chart.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const getAssertionsPerYear = async ({ input }) => {

const results = await searchedAssertions.search(
db.raw(
`count(doi) as countDoi, count(accession_number) as accessionumber, year`,
`COUNT(CASE WHEN dataset LIKE 'https://doi.org%' THEN 1 END) AS countDoi, COUNT(CASE WHEN dataset NOT LIKE 'https://doi.org%' THEN 1 END) AS accessionumber, year`,
),
)

Expand Down Expand Up @@ -275,7 +275,7 @@ const getAssertionCountsPerSource = async ({ input }) => {

results = await searchedAssertions.search(
db.raw(
`count(doi) as doiCount, count(accession_number) as accessionNumberCount , source_id`,
`COUNT(CASE WHEN dataset LIKE 'https://doi.org%' THEN 1 END) AS doiCount, COUNT(CASE WHEN dataset NOT LIKE 'https://doi.org%' THEN 1 END) AS accessionNumberCount, source_id`,
),
)

Expand Down