Skip to content

Commit

Permalink
feat: update committees endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp committed Jan 7, 2025
1 parent 9be9838 commit 13e2135
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/clients/Transparency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ const EMPTY_API: TransparencyData = {
committees: [],
}

export type TransparencyTeams = {
committees: Committee[]
}

export class Transparency {
static async getData() {
try {
Expand Down Expand Up @@ -117,4 +121,14 @@ export class Transparency {
return []
}
}

static async getTeams() {
try {
const response = (await (await fetch(`${TRANSPARENCY_API}/teams.json`)).json()) as TransparencyTeams[]
return response
} catch (error) {
ErrorClient.report('Failed to fetch transparency data', { error, category: ErrorCategory.Transparency })
return EMPTY_API
}
}
}

0 comments on commit 13e2135

Please sign in to comment.