Skip to content

Commit

Permalink
fix: annonarsClient.fetchClinvarStrucvars in case of no records (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 6, 2024
1 parent e8ff948 commit 4578e36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/annonars/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Record as HelixmtdbRecord } from '../../pbs/annonars/helixmtdb/base'
* Interface for Clinvar Strucvars query response as returned by
*/
export interface ClinvarSvQueryResponse$Api {
records: JsonValue[]
records?: JsonValue[]
}

/**
Expand All @@ -30,8 +30,9 @@ export interface ClinvarSvQueryResponse {
*/
class ClinvarSvQueryResponse$Type {
fromJson(apiResponse: ClinvarSvQueryResponse$Api): ClinvarSvQueryResponse {
const records = apiResponse.records ?? []
return {
records: apiResponse.records.map((value) => ClinvarStrucvarResponseRecord.fromJson(value))
records: records.map((value) => ClinvarStrucvarResponseRecord.fromJson(value))
}
}
}
Expand Down

0 comments on commit 4578e36

Please sign in to comment.