Skip to content

Commit

Permalink
fix: EU getCaseByCitation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hueyy committed Sep 23, 2022
1 parent 5d12e89 commit 088874e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clerkent",
"version": "3.4.2",
"version": "3.4.3",
"private": true,
"description": "quick search legal search",
"repository": "https://github.com/lacuna-technologies/clerkent.git",
Expand Down
3 changes: 2 additions & 1 deletion src/utils/scraper/EU/EU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const getCaseByName = async (caseName: string): Promise<Law.Case[]> => {

const getCaseByCitation = async (citation: string, court: string): Promise<Law.Case[]> => {
let applicableDatabases = []
Logger.log(`EU getCaseByCitation`, citation, court)
applicableDatabases = court === `EPO` ? [
databaseUseEPO(() => EPO.getCaseByCitation(citation)),
] : [
Expand All @@ -44,7 +45,7 @@ const getCaseByCitation = async (citation: string, court: string): Promise<Law.C
const results = (await Promise.allSettled(applicableDatabases))
.filter(({ status }) => status === `fulfilled`)
.flatMap(({ value }: PromiseFulfilledResult<Law.Case[]>) => value)
.filter(({ jurisdiction }) => jurisdiction === Constants.JURISDICTIONS.SG.id)
.filter(({ jurisdiction }) => jurisdiction === Constants.JURISDICTIONS.EU.id)

return sortEUCitations(
Helpers.uniqueBy(results, `citation`),
Expand Down

0 comments on commit 088874e

Please sign in to comment.