Skip to content

Commit

Permalink
fix: catch error for fetchTally function
Browse files Browse the repository at this point in the history
  • Loading branch information
kittybest committed Dec 6, 2024
1 parent 0361592 commit 4d58c27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/interface/src/utils/fetchTally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export async function fetchTally(id: string): Promise<Tally | undefined> {
body: JSON.stringify({
query: tallyQuery.replace("id: $id", `id: "${id}"`),
}),
}).then((response: GraphQLResponse) => response.data?.tally);
})
.then((response: GraphQLResponse) => response.data?.tally)
.catch(() => undefined);
}

/**
Expand All @@ -62,5 +64,7 @@ export async function fetchTallies(): Promise<Tally[] | undefined> {
body: JSON.stringify({
query: talliesQuery,
}),
}).then((r) => r.data.tallies);
})
.then((r) => r.data.tallies)
.catch(() => []);
}

0 comments on commit 4d58c27

Please sign in to comment.